Content
- Name the job in the title, in sentence case: Alarm notifications.
- Keep the subtitle to one line saying what to do here.
- Keep actions to one or two controls, such as a status or a menu.
A surface that groups related content, without adding any layout of its own.
Swap the contents, the padding and the header.
Enter your email and password.
<WildCard title="Sign in" subtitle="Enter your email and password.">
<WildFormField label="Email"><WildInput v-model="email" /></WildFormField>
<WildFormField label="Password"><WildInput v-model="password" /></WildFormField>
<WildButton variant="primary">Sign in</WildButton>
</WildCard>A white surface with a soft shadow. The header and footer are optional, and a rule splits each from the body.
Choose how alarms reach you.
<WildCard title="Alarm notifications" subtitle="Choose how alarms reach you.">
<div>Email<WildToggle v-model="email" /></div>
<div>SMS<WildToggle v-model="sms" /></div>
<div>In-app<WildToggle v-model="inApp" /></div>
<template #footer><WildButton>Save</WildButton></template>
</WildCard>Each label gives the body inset as top and bottom / sides. The header and footer keep theirs.
A card is a plain container with no role. Its title is a level-3 heading, so screen readers can jump to it.
| Key | What it does |
|---|---|
| Tab | Moves through the controls inside. The card adds no stop. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Header title, rendered as a level-3 heading. |
| subtitle | string | — | One line under the title. |
| actions | ReactNode | — | Controls at the right of the header. |
| footer | ReactNode | — | Content below the body, after a rule. |
| padding | 'none' | 'sm' | 'md' | 'lg' | 'md' | Body inset. See Padding. |
| children | ReactNode | — | The body. The card never styles it. |
| style | CSSProperties | — | Merged onto the surface. Set width here. |
| Token | Value | Where it lands |
|---|---|---|
| --card-bg | #FFFFFF | The surface. |
| --radius-2xl | 12px | Every corner. |
| (no token) | 0 4px 24px -4px …, 0 0 0 1px … | Elevation, the same shadow widgets use. |
| --color-border-default | #E6E6E6 | Header and footer rules. |
| --spacing-5 / --spacing-6 | 20px / 24px | Header: 20px top and bottom, 24px sides. |
| --spacing-4 / --spacing-6 | 16px / 24px | Footer: 16px top and bottom, 24px sides. |
| --font-size-xl | 18px | Title, at weight 500. |
| --color-text-primary | #0A090B | Title colour. |
| --font-size-md | 13px | Subtitle. |
| --color-text-secondary | #4F4D55 | Subtitle colour. |