Pre-alphaThe registry and the CLI are not published yet.Roadmap

Card

Content container, elevated or outlined.

Discover

Weekend in Porto3 days · from $240

Bookshops, port cellars and the Ribeira at sunset.

Outlined

No shadow, a border instead

Installation

npx axiom add card
pnpm dlx axiom add card
yarn dlx axiom add card
bun x axiom add card

Colors come from card.{elevated,outlined,filled}.{default,pressed} in the component tokens. The elevated shadow is a boxShadow in the component file.

Usage

import { Card } from "@/components/ui/card";

<Card variant="outlined">
	<Card.Header>
		<Card.Title>Weekend in Porto</Card.Title>
		<Card.Description>3 days · from $240</Card.Description>
	</Card.Header>
	<Card.Content>…</Card.Content>
	<Card.Footer>…</Card.Footer>
</Card>;

Props

Card

PropTypeDefaultDescription
variant'elevated' | 'outlined' | 'filled''elevated'elevated: background.elevated with a shadow, stands out on grouped backgrounds. outlined: a border, for plain backgrounds. filled: background.subtle, no border or shadow.
paddingSpacingToken | 'none''none'Inner padding for a card without sub-components. With Card.Header/Content/Footer, leave it to none: they pad themselves.
radiusRadiusToken'lg'Corner radius, 14pt by default. Media inside is clipped to it.
onPress() => void—Makes the whole card pressable with a pressed state. Buttons inside still receive their own presses.
disabledbooleanfalseWith onPress, blocks presses and lowers the opacity.
accessibilityLabelstring—With onPress, read instead of the texts inside the card: say what it opens.
childrenReactNode—The sub-components below, or any content.
styleStyleProp<ViewStyle>—Extra styles for the container.

Card.Media

PropTypeDefaultDescription
sourceImageSourcePropType—Image shown edge to edge at the top of the card.
aspectRationumber16 / 9Height relative to the card width.
childrenReactNode—Overlay content on the image, like a Badge.

Card.Header, Card.Content, Card.Footer

PropTypeDefaultDescription
childrenReactNode—Header: Card.Title, Card.Description and an optional trailing action. Content: the body. Footer: actions, laid out in a row.
styleStyleProp<ViewStyle>—Extra styles. Each part uses 16pt horizontal padding and shares the vertical spacing with its neighbors.

Use cases

Summary widget on a dashboard

A small elevated card with a value and a trend. onPress opens the details.

Today

Energy
482▲ 12% vs yesterday
Focus
3h 20▼ 20 min
Weekly goal4 / 5 days
<Card padding={4} onPress={openEnergy}>
	<Text variant="footnote" color="muted">
		Energy
	</Text>
	<Title variant="headingLg">482</Title>
	<Text variant="footnote" color="success">
		▲ 12% vs yesterday
	</Text>
</Card>

Feed item with media

Card.Media on top, a header with the author, a footer with actions.

LT

Linus TorvaldsHelsinki · 3h
<Card variant="outlined">
  <Card.Header>
    <Avatar size="sm" … />
    <Card.Title>Linus Torvalds</Card.Title>
  </Card.Header>
  <Card.Media source={{ uri: post.image }} aspectRatio={4 / 3} />
  <Card.Footer>
    <IconButton icon="heart" accessibilityLabel="Like" />
    <IconButton icon="send" accessibilityLabel="Share" />
  </Card.Footer>
</Card>

Cards with a fixed width in a Carousel, peeking at the next one.

Continue watchingSee all
<Carousel
	data={shows}
	itemWidth={230}
	renderItem={({ item }) => (
		<Card onPress={() => play(item.id)}>
			<Card.Media source={item.poster} />
			<Card.Content>…</Card.Content>
		</Card>
	)}
>
	<Carousel.List />
</Carousel>

Guidelines

Avoid nesting cards inside cards. On a small screen, every level of padding and border takes space from the content. See Mobile design guidelines.

Compositions

Built with Card: ready-made interfaces you install with npx axiom add, not examples. See Example or composition?.

Product Card
Product image, name, price, an optional badge and an add-to-cart button.
  • Card
  • Text
  • Badge
  • Button
Listing Card
A home or a stay: photo, price, address and specs, stacked or over the photo.
  • Card
  • Badge
  • Separator
  • Icon
  • Text
  • Title
  • Avatar
  • Button
Recipe Card
Recipe photo, name, time, servings and difficulty, ingredient chips and a cook button.
  • Card
  • Chip
  • Badge
  • Separator
  • Icon
  • Text
  • Button
Profile Card
Avatar, name, short bio, stats and follow and message buttons.
  • Card
  • Avatar
  • Title
  • Text
  • Separator
  • Button
Article Card
Cover image, category, headline, excerpt, author and reading time.
  • Card
  • Title
  • Text
  • Avatar
Event Card
Event photo with a date tile, time and place, who's going and a ticket button.
  • Card
  • Title
  • Text
  • Icon
  • Avatar
  • Button
Offer Card
Card art, a badge, the main benefit, short highlights, the fee and an apply button.
  • Card
  • Badge
  • Title
  • Text
  • Icon
  • Button
Pricing Card
Plan name, price and period, features, and a button, with featured and current states.
  • Card
  • Badge
  • Title
  • Text
  • Icon
  • Button
Stats Card
A metric, its label and icon, and its change against the last period.
  • Card
  • Title
  • Text
  • Badge
  • Icon