Skip to contents
Interfaces DS
Landing Page

DESIGN.md

Share the visual decisions that keep independently generated screens consistent.

On this page

Share the design rules

Save the rules in the consuming project’s DESIGN.md. Point to that file from AGENTS.md, and adapt its theme choices to the application.

File contents

MARKDOWN
# Interfaces DS design

The Dashboard theme defines the roles below. Defaults are measured at a 16 px root font size. Let the underlying primitive manage focus, selection and dismissal. Apply visual treatments to the states it exposes.

## Choose the surface

- **Inline content** sits on the page canvas. Use a heading and space to group an accordion, a table or a set of fields.
- **A panel** keeps related content on one reading edge. Card and Alert share `--ds-panel`, `--ds-panel-shadow` and `--ds-radius-panel` (24 px). Card sections share `--ds-panel-padding` (24 px). The more compact Alert uses 16 px and aligns its icon and dismiss action to the first line.
- **A field** uses `--ds-well` and the field shadow. Pair this recessed surface with a persistent label. Match its height to adjacent actions.
- **An anchored popup** uses `--ds-floating`, `--ds-edge`, `--ds-flyout-shadow` and `--ds-radius-flyout` (16 px). In a menu, the option radius is the outer radius minus the 1 px border and the list padding (4 px by default), down to zero. Popover and Hover Card give prose 20 px of padding. A short Tooltip uses a compact 8 px corner.
- **A modal task** uses the floating material with `--ds-radius-dialog` (24 px) and a backdrop. Dialog and Alert Dialog round all four corners. Sheet and Drawer round the corners facing the page. Modal content has a 24 px reading inset, reduced to 16 px at viewport widths of 440 px and below.

Place the Dashboard theme on the document root so menus and dialogs inherit these roles through portals. Override a shared role on the theme root for a product-wide change. Use a component class or its documented override for a local exception.

## Space and separate

Use the 4, 8, 12, 16, 20 and 24 px spacing scale (`--ds-space-1` through `--ds-space-6`). Start with 4 px between a card title and its description, 8 px between a field label and control, and 20 px between fields in a form. Keep the Card title, content and footer action on the same reading edge. Leave room around a card in a carousel for its shadow.

Use whitespace between card sections and modal actions. Keep one rule under table headings and a tinted total row. Menu group labels introduce their items directly. Add a separator when adjacent commands belong to different tasks. Keep focus outlines, selected indicators and resize handles visible. Use Scroll Fade on a scroll region to hint at content beyond its edges. Let its gradient match the underlying surface and leave enough scroll margin for headings and focused controls.

## Size and type

Choose compact, standard or large controls for a row using `--ds-control-sm`, `--ds-control-md` and `--ds-control-lg` (36, 44 and 48 px). Compact row controls expand to 44 px on coarse pointers. A square icon action uses the same width and height. Toggle and Toggle Group items use 28, 32 and 36 px toolbar sizes with 6 px corners. The default icon stays 16 px. Touch targets expand to 44 px. A joined group has 2 px gaps and padding, with an 8 px outer radius. The Switch thumb is a 20 px square with a 3 px corner.

Use capsule buttons for actions and a 12 px corner for a standard field. Use one raised primary action per group. Use the secondary variant for supporting actions.

Card and modal headings use 20 px semibold with a 1.3 line height. Standard controls use 14/20 px. Menu group labels, keyboard shortcuts, Badge and Kbd share the 12/16 px caption scale; shortcuts and key names use a monospace face. Error and help text use 13/18 px in a Field. Compare amounts on a shared edge with tabular numerals. When a table scrolls horizontally, show a soft fade only at an edge with more columns. Keep a long Select value on one line in the trigger and wrap the full label inside its option, with separate space for the selection mark.

### AI conversation

Use 4 px between the sender label and body, 8 px between paragraphs or related controls, and 12 px between turns. Compact AI controls are 32 px tall and expand to at least 44 × 44 px on coarse pointers. Use 12 px insets and 10 px corners on nested conversation surfaces. Use 14 px for the user prompt and 15 px for assistant prose, with a reading width of up to 66 characters. Group activity and sources behind a disclosure in the message header. A two-party thread can use alignment to show who spoke and keep the accessible names on both turns. Place optional working context alongside Send and Stop. When the composer is narrower than 24 rem, use a compact, named reference action beside the draft so a short reply still fits on one row. Keep errors and approval requests visible in the turn. Let confirmation actions wrap beneath their description when space runs out.

## Show state

Neutral actions use `--secondary`, `--secondary-hover` and `--secondary-active` with `--secondary-foreground`. Hover gives a subtle pointer cue. Menus, Select and Command share a soft highlight measured against their floating surface. Pressed shows actuation. A persistent check, thumb position or selected indicator identifies the stored value after release. Keyboard focus has its own outline. Use a contrasting inset outline on a selected Calendar day. Horizontal Tabs scroll within the strip when labels exceed its width. Vertical Tabs stack in the order used by the arrow keys. Checkbox and Radio share a filled selected face with a contrasting mark. Switch and Slider share a raised thumb with a short shadow. The Slider rail is 4 px on the default scale, with a 44 px cross-axis touch target.

For a filled destructive action or danger badge, pair `--danger` with `--danger-foreground`. A filled action uses `--danger-hover` and `--danger-active` for its other faces. For error copy and destructive text on a neutral or tinted surface, use `--danger-text`. Keep an error message with the field and expose invalid or disabled state through the control. Check normal-size text against its actual surface at 4.5:1 or higher in both color modes.

## Verify a composition

Open the settings editor from its trigger. Change a value with the keyboard, cancel, reopen and save. Check the visible focus, committed value and focus return. Repeat on a narrow viewport. When a theme role changes, verify at least two consumers and a popup rendered through a portal.