React Shared Components

Interactive testing environment for react-shared components

Theme Playground

Current: Default

Price

Display product pricing with support for sale prices, intervals, and flexible payment options.

Interactive Playground

Customize the Price properties and see the changes in real-time.

$49.99

Examples

Common use cases and variations.

Simple Price

$29.99

Sale Price

$39.99$49.99

Subscription Price

$19.99

/Month

Opaque Layout

$79.99$99.99

Rounded Layout

$149.99

Product Detail Page

$249.99$299.99

API Reference

Complete list of props and their descriptions.

PropTypeDefaultDescription
amountnumberundefinedRegular price amount
saleAmountnumber | stringundefinedSale price (shows original as strikethrough)
currencystring'USD'Currency code for formatting
intervalstringundefinedBilling interval (e.g., 'month', 'year')
layout'default' | 'opaque' | 'stroke' | 'rounded' | 'border''default'Visual layout style
variant'default' | 'pdp''default'Display variant (pdp = product detail page with larger text)
stanFlexiblePaymentPriceobjectundefinedFlexible payment plan configuration
showFlexiblePricebooleanfalseShow flexible payment option text
classNamestringundefinedAdditional CSS classes

Usage Notes

Sale Pricing

When saleAmount is provided, it displays prominently with the original amount shown as strikethrough.

Flexible Payments

Enable installment payment options by providing stanFlexiblePaymentPrice configuration with enabled, amount, duration, and interval.

Theme Integration

The component respects theme configuration for layout through the useThemeLayout hook. Some themes may display custom icons.

Currency Formatting

Prices are automatically formatted based on the currency prop using the formatCurrency utility function.