Import
Usage
Props
Predefined price options (scrollable horizontally).
price: Amount in the specified currencydata: Optional feature list shown below price with Lucide icons
Currency symbol (e.g.,
"€", "$", "£").Callback with selected/entered price. Validates minimum from first option.
Floating label above options. Use
{{value}} for dynamic calculation based on labelValueConversion.Multiplier for
{{value}} in label (e.g., 0.1 converts 100€ to “10 coffees”).Pre-select an option by price. Component auto-scrolls to center this option.
Hide custom amount input field at the end. Default:
false.Custom element shown below custom amount input (e.g., benefits list).
Custom CSS properties for the container.
Custom CSS properties for the options row container.
Option Cell Structure
Each price option displays:- Price: Large number with currency symbol (responsive font size)
- Data items (optional): Icon + text list below a divider
- Selection state: Primary blue border and background when selected
- Hover effect: Blue background and border on hover
Features
Auto-centering
- Selected option automatically scrolls to center horizontally
- Smooth scroll animation
- Works on initial mount and when selection changes
Dynamic Font Sizing
Adjusts number font size based on the largest price:-
5 digits: 16px
-
4 digits: 18px
-
3 digits: 21px
- ≤ 3 digits: 24px (default)
Custom Amount Validation
- Minimum price enforced from
options[0].price - Spanish error message:
"La donación mínima es de {min}€" - Validates on blur
- Red border on error
Spanish Number Formatting
UsestoLocaleString("es-ES") with thousand separators:
1000→"1.000"50000→"50.000"
Examples
Donation Amounts
Subscription Plans
Simple Price Selection (No Data)
With Custom Amount Benefits
Responsive Width Control
Styling Details
Option Cell
- Width: 247px (minimum when data exists)
- Border radius: 16px
- Default: 1px neutral soft border
- Selected: 2px primary blue border + primary soft background
- Hover: 2px primary blue border + primary soft background
Custom Amount Input
- Border radius: 16px
- Height: 56px
- Font: Same responsive sizing as options
- Placeholder: “Otra cantidad”
- Dynamic width: Expands based on number of digits entered
Label
- Background: Primary blue
- Color: White
- Border radius: 8px
- Max width: 50% (100% on mobile)
- Arrow: Positioned based on selected option (left/center/right)
Icon Names
Use Lucide React icon names as strings in thedata.icon field:
"Check","X","Heart","Star""Coffee","Gift","Award","Crown""FileText","Download","Upload""Headphones","Phone","Mail"- See lucide.dev for full list
Validation Behavior
Mobile Behavior
- Horizontal scroll: Swipe to browse options
- Touch-friendly: 247px minimum width for easy tapping
- Centered selection: Auto-scrolls selected option to center
- Label max-width: 100% on small screens