Design
Buttons and forms
Button, Input, Checkbox, Switch, Segmented Tabs and the Composer: what each is for, how it looks, and its properties.
Button
One primary button per view. Neutral for everything else. Icons sit at 16px with 6px of gap.
Variants
<Button.Root variant="primary" mode="filled">
Get started
<Button.Icon as={ArrowRightIcon} />
</Button.Root>
<Button.Root variant="neutral" mode="stroke">Book a call</Button.Root>
<Button.Root variant="error" mode="filled">Delete routine</Button.Root>
Sizes
Heights 28, 32, 36 and 40px.
<Button.Root size="xxsmall">Extra small</Button.Root>
<Button.Root size="small">Small</Button.Root>
<Button.Root size="medium">Medium</Button.Root>
With icons and states
A pending button keeps its width and swaps the icon for the hop while the work runs. An icon-only button is a compact button, and gets a tooltip.
<PendingButton onClick={publish} icon={CustomDomainIcon}>Publish funnel</PendingButton>
<CompactButton.Root><CompactButton.Icon as={CopyIcon} /></CompactButton.Root>
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "primary" | "neutral" | "error" | "primary" | Colour family. |
mode | "filled" | "stroke" | "lighter" | "ghost" | "filled" | Surface weight. |
size | "xxsmall" | "xsmall" | "small" | "medium" | "medium" | Height 28 / 32 / 36 / 40px. |
disabled | boolean | false | Disables the button. |
asChild | boolean | false | Render as the child element, e.g. a Link. |
Input
Inputs have a label above, a hint below, and an optional icon or affix inside. An error replaces the hint.
Basic
<Input.Root>
<Input.Wrapper>
<Input.Icon as={SearchIcon} />
<Input.Input placeholder="Name, email or phone" />
</Input.Wrapper>
</Input.Root>
Affix and error
<Input.Root hasError>
<Input.Wrapper><Input.Affix>$</Input.Affix><Input.Input /></Input.Wrapper>
</Input.Root>
<Hint.Root hasError>Above your $2,000 monthly spend cap.</Hint.Root>
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
size | "small" | "medium" | "medium" | Height 36 or 40px. |
hasError | boolean | false | Error border and hint tone. |
disabled | boolean | false | Disables the field. |
Checkbox
Use checkboxes for independent choices. Use a switch when the choice takes effect immediately. The boxes below work: click them.
Basic
<Checkbox.Root defaultChecked id="pause" />
<Label.Root htmlFor="pause">Pause ads that fatigue</Label.Root>
With description
<Checkbox.Root id="spend" defaultChecked />
<div>
<Label.Root htmlFor="spend">Require approval for spend</Label.Root>
<Hint.Root>Anything that changes ad budget waits for you.</Hint.Root>
</div>
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | "indeterminate" | — | Controlled state. |
defaultChecked | boolean | false | Uncontrolled initial state. |
onCheckedChange | (checked: boolean) => void | — | Change handler. |
disabled | boolean | false | Disables the box. |
Switch
A switch takes effect the moment it flips. If the change needs a save, use a checkbox. These switches flip.
Settings rows
<Switch.Root checked={yolo} onCheckedChange={setYolo} />
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled state. |
defaultChecked | boolean | false | Uncontrolled state. |
onCheckedChange | (checked: boolean) => void | — | Change handler. |
disabled | boolean | false | Disables the switch. |
Segmented Tabs
A segmented control switches a view in place. A tab menu switches between sections of a page.
Segmented control
<SegmentedControl.Root defaultValue="day">
<SegmentedControl.List>
<SegmentedControl.Trigger value="hour">Hour</SegmentedControl.Trigger>
<SegmentedControl.Trigger value="day">Day</SegmentedControl.Trigger>
</SegmentedControl.List>
</SegmentedControl.Root>
Tab menu
<TabMenuHorizontal.Root defaultValue="overview">
<TabMenuHorizontal.List>
<TabMenuHorizontal.Trigger value="overview"><ReportsChartIcon /> Overview</TabMenuHorizontal.Trigger>
</TabMenuHorizontal.List>
</TabMenuHorizontal.Root>
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled active segment. |
defaultValue | string | — | Uncontrolled initial segment. |
onValueChange | (value: string) => void | — | Change handler. |
Composer
Ask like you would ask a teammate. The composer picks a department, takes files, and sends with Enter.
Chat composer
<Composer.Root onSubmit={send}>
<Composer.Input placeholder="Ask Cook or tell it what to do…" />
<Composer.Footer>
<DepartmentPicker value={dept} onChange={setDept} />
<Composer.Attach />
<Composer.Send />
</Composer.Footer>
</Composer.Root>
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
onSubmit | (text: string, files: File[]) => void | — | Called on Enter or send. |
department | DeptKey | "staff" | Who receives the message. |
disabled | boolean | false | While a reply streams. |