Card

Container with a sketch border. Optional offset rectangle behind it reads as a paper shadow. The border draws in on mount.

Field notes
A container with a sketch border. Text inside stays HTML.
<Card title="Field notes" shadow={true} roughness={1.5}>
  A container with a sketch border.
</Card>

CLI install

npx doodleui-react add card

Usage

import { Card } from "doodleui-react";

// Compound (preferred)
<Card>
  <Card.Header>
    <Card.Title>Field notes</Card.Title>
    <Card.Description>Optional subtitle</Card.Description>
  </Card.Header>
  <Card.Content>A container with a sketch border.</Card.Content>
  <Card.Footer>Actions</Card.Footer>
</Card>

// Legacy props still work
<Card title="Field notes" footer="Actions" shadow>
  Body
</Card>

// Polymorphic root
<Card asChild>
  <article>…</article>
</Card>

Named exports (CardHeader, CardTitle, …) are also available. Cards do not bundle drop-shadow CSS — the shadow is another rough.js rectangle.

Props

PropTypeDefaultNotes
titleReactNodeundefinedOptional heading inside the card.
footerReactNodeundefinedOptional footer row.
shadowbooleantrueOffset hachure rectangle behind the card.
fillstringundefinedrough.js fill color for the face rectangle.
animatebooleantrueDraw-in the border on mount. Overrides DoodleUIProvider. Reduced motion disables this unless the provider set forceAnimate.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.