A container for grouping related content with optional header and footer.
Import
import{Card}from'@oztix/roadie-components/card'
Examples
Default
<Cardhref='#'><Card.Header><Card.Title>Midnight Frequency</Card.Title><Card.Description>Live at The Triffid, Brisbane</Card.Description></Card.Header><Card.Content><p>An evening of electronic beats and ambient soundscapes under the stars.</p></Card.Content></Card>
Emphasis
<divclassName='grid gap-4'><Cardhref='#'emphasis='raised'><Card.Header><Card.Title>Raised</Card.Title><Card.Description>Featured event</Card.Description></Card.Header><Card.Content><p>Use for primary or featured content that should stand out.</p></Card.Content></Card><Cardhref='#'emphasis='normal'><Card.Header><Card.Title>Normal</Card.Title><Card.Description>Standard event</Card.Description></Card.Header><Card.Content><p>Default emphasis for general-purpose cards.</p></Card.Content></Card><Cardhref='#'emphasis='subtle'><Card.Header><Card.Title>Subtle</Card.Title><Card.Description>Related event</Card.Description></Card.Header><Card.Content><p>Use for secondary or supporting content.</p></Card.Content></Card><Cardhref='#'emphasis='subtler'><Card.Header><Card.Title>Subtler</Card.Title><Card.Description>Background content</Card.Description></Card.Header><Card.Content><p>Invisible at rest — reveals on hover. Use for interactive lists or grids.</p></Card.Content></Card></div>
Intents
<divclassName='grid gap-4'><Cardhref='#'intent='accent'emphasis='subtle'><Card.Content><pclassName='text-sm font-semibold'>On sale now</p><pclassName='text-sm'>Early bird tickets available until Friday.</p></Card.Content></Card><Cardhref='#'intent='success'emphasis='subtle'><Card.Content><pclassName='text-sm font-semibold'>Booking confirmed</p><pclassName='text-sm'>Your tickets for Sunset Sounds have been reserved.</p></Card.Content></Card><Cardhref='#'intent='danger'emphasis='subtle'><Card.Content><pclassName='text-sm font-semibold'>Almost sold out</p><pclassName='text-sm'>Only 12 tickets remaining for Neon Dusk.</p></Card.Content></Card></div>
With image
The subtler card has padding around the image, giving it inset rounded corners. The normal card uses a full-bleed image with overflow-hidden.
<divclassName='grid grid-cols-2 gap-4'><Cardhref='#'emphasis='subtler'><Card.Imagesrc='https://placehold.co/600x600/1a1a2e/e0e0e0?text=Harbour+Cruise'alt='Sunset Harbour Cruise'className='aspect-square'/><Card.Header><Card.Title>Sunset Harbour Cruise</Card.Title><Card.Description>17 May · 6:00 PM</Card.Description><Card.Description>Riverside Wharf</Card.Description></Card.Header><Card.Footer><pclassName='text-strong font-semibold'>$89</p></Card.Footer></Card><Cardhref='#'className='overflow-hidden'><Card.Imagesrc='https://placehold.co/600x300/2e1a2e/e0e0e0?text=Chef+Dinner'alt='Long Table Dinner'/><Card.Header><Card.Description>Dining & Social</Card.Description><Card.Title>Long Table Dinner with Marco Bellucci</Card.Title><Card.Description>24 May · 3 hrs</Card.Description></Card.Header></Card></div>
Composition
Use Card.Header, Card.Content, and Card.Footer to structure content.
<Card><Card.Header><Card.Title>Sunset Sounds Festival</Card.Title><Card.Description>3-day music festival — Gold Coast Parklands</Card.Description></Card.Header><Card.Content><p>Three days of live music across four stages featuring local and international artists. Food trucks, art installations, and late-night DJ sets.</p></Card.Content><Card.Footer><Buttonsize='sm'>Buy tickets</Button><Buttonsize='sm'emphasis='subtler'>Learn more</Button></Card.Footer></Card>
API reference
Card
as?ElementType
@deprecated Use `render` instead. `as` will be removed in v3.0.0.
Pass `render={<button onClick=… />}` for a clickable card, or
`render={<MyLink href='/x' />}` for a custom link wrapper. The
`render` prop accepts an element, a component, or a function
`(defaultProps) => element` for full control.
href?string
Pass an href to render the card as a routed anchor. Internal hrefs
route through the configured `RoadieLinkProvider`; external hrefs
(`http(s)://`, `//…`) render `<a target='_blank' rel='noopener noreferrer'>`;
`mailto:` / `tel:` / `sms:` render plain `<a>`. Use `external` to
override the auto classification.
`render` always wins over `href` smart-routing — pass `render` to
render a non-anchor or to bypass provider routing.
external?boolean
Force external-link treatment when `href` is set. Has no effect
when `render` is set — the consumer's element is responsible for
its own target/rel.
target?string
Override the auto `target='_blank'` default on external hrefs.
rel?string
Override the auto `rel='noopener noreferrer'` default on external hrefs.
render?RoadieRenderProp
Escape hatch — swap the underlying element with full control over
the rendered shape. See [Linking](/foundations/linking) for the
full reference.