ReScript Shadcn
Get started
  • Installation
Components
  • Accordion
  • Alert
  • AlertDialog
  • AspectRatio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • ContextMenu
  • DataTable
  • DatePicker
  • Dialog
  • Direction
  • Drawer
  • DropdownMenu
  • Empty
  • Field
  • HoverCard
  • Input
  • InputGroup
  • InputOtp
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • MessageScroller
  • NativeSelect
  • NavigationMenu
  • Pagination
  • Popover
  • Progress
  • RadioGroup
  • Resizable
  • ScrollArea
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sonner
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • ToggleGroup
  • Tooltip
  • Typography

Card

Displays a card with header, content, and footer.

Login to your account
Enter your email below to login to your account
Forgot your password?

Installation#

npx shadcn@latest add @rescript-shadcn/Card

Usage#

<Card>
  <Card.Header>
    <Card.Title> {"Card Title"->React.string} </Card.Title>
    <Card.Description> {"Card Description"->React.string} </Card.Description>
    <Card.Action> {"Card Action"->React.string} </Card.Action>
  </Card.Header>
  <Card.Content>
    <p> {"Card Content"->React.string} </p>
  </Card.Content>
  <Card.Footer>
    <p> {"Card Footer"->React.string} </p>
  </Card.Footer>
</Card>

Examples#

Size#

Use the size=Sm prop to set the size of the card to small. The small size variant uses smaller spacing.

Scheduled reports
Weekly snapshots. No more manual exports.
  • Choose a schedule (daily, or weekly).
  • Send to channels or specific teammates.
  • Include charts, tables, and key metrics.

Image#

Add an image before the card header to create a card with an image.

Event cover
Featured
Design systems meetup
A practical talk on component APIs, accessibility, and shipping faster.

API Reference#

Card#

The Card component is the root container for card content.

PropTypeDefault
sizeDefault | SmDefault
classNamestring-

CardHeader#

The CardHeader component is used for a title, description, and optional action.

PropTypeDefault
classNamestring-

CardTitle#

The CardTitle component is used for the card title.

PropTypeDefault
classNamestring-

CardDescription#

The CardDescription component is used for helper text under the title.

PropTypeDefault
classNamestring-

CardAction#

The CardAction component places content in the top-right of the header (for example, a button or a badge).

PropTypeDefault
classNamestring-

CardContent#

The CardContent component is used for the main card body.

PropTypeDefault
classNamestring-

CardFooter#

The CardFooter component is used for actions and secondary content at the bottom of the card.

PropTypeDefault
classNamestring-
@react.component
let make = () =>
  <Card className="w-full max-w-sm">
@react.component
let make = () => {
  let featureName = "Scheduled reports"
@react.component
let make = () =>
  <Card className="relative mx-auto w-full max-w-sm pt-0">