Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { Card } from '@dryui/ui';
</script>

<Card.Root>
  <Card.Header>Title</Card.Header>
  <Card.Content>
    <p>Card body content goes here.</p>
  </Card.Content>
  <Card.Footer>
    <Button variant="solid">Action</Button>
  </Card.Footer>
</Card.Root>

Import options

Root package

ts
import { Card } from '@dryui/ui'

Per-component subpath

ts
import { Card } from '@dryui/ui/card'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Notification Card

Notifications

You have 3 unread messages.

Olivia Wilson

Pushed 2 commits to feat/auth

2 min ago

James Chen

Commented on your pull request

14 min ago

Sofia Rodriguez

Requested your review

1 hr ago

svelte
<Card.Root>
  <Card.Header>
    <h3>Notifications</h3>
    <p>You have 3 unread messages.</p>
  </Card.Header>
  <Card.Content>
    <Stack gap="md">
      <div class="notification-item">
        <Avatar fallback="OW" size="sm" status="online" />
        <div class="notification-text">
          <p class="notification-name">Olivia Wilson</p>
          <p class="notification-msg">Pushed 2 commits to feat/auth</p>
          <p class="notification-time">2 min ago</p>
        </div>
        <Badge variant="dot" color="blue" />
      </div>
      <Separator />
      <div class="notification-item">
        <Avatar fallback="JC" size="sm" />
        <div class="notification-text">
          <p class="notification-name">James Chen</p>
          <p class="notification-msg">Commented on your pull request</p>
          <p class="notification-time">14 min ago</p>
        </div>
        <Badge variant="dot" color="blue" />
      </div>
      <Separator />
      <div class="notification-item">
        <Avatar fallback="SR" size="sm" />
        <div class="notification-text">
          <p class="notification-name">Sofia Rodriguez</p>
          <p class="notification-msg">Requested your review</p>
          <p class="notification-time">1 hr ago</p>
        </div>
        <Badge variant="dot" color="blue" />
      </div>
    </Stack>
  </Card.Content>
  <Card.Footer>
    <Button variant="outline" style="width: 100%">View all notifications</Button>
  </Card.Footer>
</Card.Root>

Card with Header, Content, and Footer

Card Title

Card subtitle or description

This is the main content area of the card. You can put anything here.

svelte
<Card.Root>
  <Card.Header>
    <h3>Card Title</h3>
    <p>Card subtitle or description</p>
  </Card.Header>
  <Card.Content>
    <p>This is the main content area of the card. You can put anything here.</p>
  </Card.Content>
  <Card.Footer>
    <Button variant="outline">Cancel</Button>
    <Button>Confirm</Button>
  </Card.Footer>
</Card.Root>

Structure

Compound components always start with Card.Root. Use this structure block to understand required wrappers before you wire state or styling.

Card.Root
  Card.Header
  Card.Content
  Card.Footer
Card.Root Card.HeaderCard.ContentCard.Footer

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Compound component. Start with Card.Root, then add only the parts you need.

Card.HeaderCard.ContentCard.Footer

Card.Root

Prop Type Default Required Bindable
as
divabutton
selected
boolean
orientation
verticalhorizontal
variant
defaultelevatedinteractive
'default'
size
defaultsm
'default'
children
Snippet

Forwards <element> attributes via rest props. Common examples: id, class, aria-label.

Card.Header

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Card.Content

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

Card.Footer

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.