Page:
Card
Pages
Accordion
AccordionItem
Alert
Avatar
Badge
BarChart
Button
ButtonGroup
Card
Changelog
ChartLegend
Checkbox
CodeEditor
Collapsible
Combobox
CommandPalette
ContextMenu
CopyButton
DatePicker
Dialog
DonutChart
Drawer
Field
FileInput
FileList
Forms
Gauge
Getting started
Heatmap
Home
Image
InlineEdit
Input
Kbd
Label
LineChart
Menu
MultiSelect
NumberInput
Overlays
Pagination
Popover
Progress
RadioGroup
Scroller
Select
Separator
ShareBar
Sheet
Skeleton
Slider
Sparkline
Spinner
StatCard
Switch
Table
Tabs
TagsInput
Textarea
Theming
Toaster
Toggle
Tooltip
Tree
No results
2
Card
L4stIdi0t edited this page 2026-09-08 22:50:57 +02:00
Card
Surface for a block of related content: an optional title and description header, then whatever you render inside.
The header snippet replaces the title/description pair when a card needs an action in its corner.
Layout
<script lang="ts">
import { Card } from '@l4st/driftwood';
</script>
| Light | Dark |
|---|---|
![]() |
![]() |
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
title |
string |
— | Rendered as the card's heading. Omit for a bare surface. |
description |
string |
— | One line under the title, in muted text. |
class |
string |
— | Merged with the component's own classes, last — so yours win. |
header |
Snippet |
— | Optional custom header content (e.g. an action button) — replaces title/description. |
children required |
Snippet |
— | The content. |
Example
The markup behind the screenshot above, lifted from src/routes/shots/ — so it
compiles, and it is exactly what produced the image.
<Card title="Nightly scan" description="Runs at 02:00 on volume1.">
<p class="text-muted-foreground text-sm">
2.56M files · 527 GB indexed, 4 minutes 12 seconds.
</p>
</Card>
Layout · StatCard · Accordion · AccordionItem · Collapsible · Separator · Table · Scroller
driftwood
Layout
Actions
Forms
- Field
- Input
- FileInput
- FileList
- Textarea
- CodeEditor
- Combobox
- RadioGroup
- NumberInput
- InlineEdit
- Label
- Select
- MultiSelect
- DatePicker
- TagsInput
- Checkbox
- Switch
- Slider
Feedback
Charts
Overlays
Navigation
Generated from the source by pnpm wiki · repository · v0.24.0

