Documentation Upgrade
Start here
CwCard gives you a consistent container for summaries, forms, charts, and lists. Use the simple title props first, then switch to snippets only when the header needs custom layout.
Copy-paste examples
These snippets intentionally show the full public API surface the live demo relies on.
Simple summary card
Use this version for most dashboard tiles.
<CwCard title="Device summary" subtitle="Greenhouse 7" elevated>
{#snippet actions()}
<CwButton size="sm" variant="ghost">Refresh</CwButton>
{/snippet}
{#snippet children()}
<p>All irrigation zones reported in the last 5 minutes.</p>
{/snippet}
</CwCard>
Custom header and full-bleed body
Switch to snippets when the header layout needs custom composition.
<CwCard padded={false}>
{#snippet header()}
<div style="padding:1rem 1rem 0;display:flex;justify-content:space-between;gap:1rem">
<div>
<h3 style="margin:0">Reservoir trend</h3>
<p style="margin:0.35rem 0 0">24 hour water level</p>
</div>
<CwBadge value="Live" tone="success">
<span />
</CwBadge>
</div>
{/snippet}
{#snippet children()}
<div style="height:14rem;background:var(--cw-bg-muted)"></div>
{/snippet}
</CwCard>