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 { StatCard } from '@dryui/ui';
</script>

<StatCard.Root tone="info">
  <StatCard.Label>Total travel spend</StatCard.Label>
  <StatCard.Value>$613M</StatCard.Value>
  <StatCard.Trend direction="up">12.4% vs last quarter</StatCard.Trend>
</StatCard.Root>

Import options

Root package

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

Per-component subpath

ts
import { StatCard } from '@dryui/ui/stat-card'

Customize

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

Dashboard Metrics

Total travel spend
$613M
12.4% vs last quarter
svelte
<StatCard.Root tone="info">
  <StatCard.Label>Total travel spend</StatCard.Label>
  <StatCard.Value>$613M</StatCard.Value>
  <StatCard.Trend direction="up">12.4% vs last quarter</StatCard.Trend>
</StatCard.Root>

Policy Snapshot

Policy compliance
98.2%
+2.1 points this month
svelte
<StatCard.Root tone="success" density="compact">
  <StatCard.Label>Policy compliance</StatCard.Label>
  <StatCard.Value>98.2%</StatCard.Value>
  <StatCard.Trend direction="up">+2.1 points this month</StatCard.Trend>
</StatCard.Root>

Risk Indicator

Blocked bookings
14
3 more than yesterday
svelte
<StatCard.Root tone="danger">
  <StatCard.Label>Blocked bookings</StatCard.Label>
  <StatCard.Value>14</StatCard.Value>
  <StatCard.Trend direction="down">3 more than yesterday</StatCard.Trend>
</StatCard.Root>

Structure

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

StatCard.Root
  StatCard.Label
  StatCard.Value
  StatCard.Trend
StatCard.Root StatCard.LabelStatCard.ValueStatCard.Trend

Compose

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

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

StatCard.LabelStatCard.ValueStatCard.Trend

StatCard.Root

Prop Type Default Required Bindable
tone
neutralinfosuccesswarningdanger
'neutral'
density
comfortablecompact
'comfortable'
children
Snippet

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

StatCard.Label

Prop Type Default Required Bindable
children
Snippet

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

StatCard.Value

Prop Type Default Required Bindable
children
Snippet

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

StatCard.Trend

Prop Type Default Required Bindable
direction
updownflat
'flat'
children
Snippet

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