Skip to Content
Urban Cowboy
Components

ConfigurableRateCard

CMS-configured rate artwork shell with live price overlay, layouts and an expandable booking action.

ConfigurableRateCard combines editor-controlled artwork and copy (config) with live pricing (live). The artwork is decorative; important words are rendered as semantic HTML over it. Its action follows a two-step pattern: the first press expands to a confirmation, and the second calls onBook. The docs harness keeps that state local and never creates a reservation or starts a payment.

*
*
boolean

States and layouts

The former Storybook Vertical, Horizontal, SingleBorder, DoubleBorder, OutlineButton, Expanded, Disabled and HorizontalExpanded states are collected in the grid below, using a deterministic fixture with no artwork so the semantic fallback is shown.

Props

PropValuesNotes
configRateCardConfigCMS fields: copy, colours, border/font presets, overlay positions, cancellation windows
liveRateCardLiveContentAlready-formatted price, priceUnit, taxLabel, cancellationText, optional ctaLabel
layoutvertical, horizontalHorizontal uses a measured overlay layout
artworkModeauto, desktop, mobileWhich artwork source is preferred
isExpanded / onExpandboolean / callbackDrives the confirm step
onBookcallbackCalled on the confirmed action
confirmLabelstringLabel shown in the expanded state
disabledbooleanDisables the action
classNamestringPlacement only

When any artwork URL fails to load, the card falls back to its semantic copy. Both price and cancellation text are supplied by the caller; the component performs no pricing or policy calculation.

Responsive behaviour

The vertical card is capped to a narrow column and the horizontal card uses a width-aware overlay scale. The variant grid goes from one column on phones to two or three at sm, so every state can be compared without horizontal scrolling.

Usage

import { ConfigurableRateCard } from '@/components/rates/ConfigurableRateCard';

<ConfigurableRateCard
  config={rateConfig}
  live={{ price: '$340', taxLabel: '+ $28 taxes & fees', cancellationText: 'Flexible cancellation' }}
  onBook={() => continueToBooking()}
/>

View source