Design system
The parts
of the app
The Chatto web app is built from a small set of shared parts. This page shows the best of them.
Each example is the real component of the web app, with its real styles. The controls below are the appearance settings of the app. Change them, and each example follows.
Four surface levels
Chatto separates the areas of a screen with fills. Four surface colours give four levels.
- A nested element goes up one level at most.
backgroundcontainssurface,surfacecontainssurface-emphasized, andsurface-emphasizedcontainssurface-strong. - If one level does not separate two areas sufficiently, add a border or change the composition. Do not skip a level.
- The light theme and the dark theme are not mirror images. In the light theme,
surfaceis a tinted grey for the parts that stay on the screen. In the dark theme, each level is lighter than the level below it. - In the light theme, white is for form fields.
Source themes.csstokens.css
A colour has a meaning
A colour token names an intent, not a look. Feature code uses action or danger, and never a palette colour such as blue.
-
actionis the accent that the user selects. Nine accents exist, and cyan is the default. Change the accent above. - The warning, danger, presence, and server identity colours do not change with the accent.
- The accent is never the only sign of a status.
- A
Pillis the label for a status or a scope. It replaces each one-off coloured badge.
Source Pill.sveltethemes.css
Depth is a setting
Raised controls have a faint highlight at the top and a soft rim. Empty indicators look recessed. The user decides how much.
- The Depth setting goes from 0 to 100. At 0 the app is flat, 50 is the default, and 100 is very 3D. Move the slider above.
- Feature code does not add its own gradient or shadow. It uses the shared depth utilities, such as
control-raisedandsurface-lowered. - Buttons have no cast shadow. A pressed button changes its fill. A ghost button stays flat, and a disabled control has no depth.
Source controls.cssthemes.css
One recommended action
Button has one variant for each meaning. The default variant, action, marks the recommended action.
-
neutralgives emphasis without competition with the recommended action.secondaryis for Cancel and for quiet alternatives.ghostis for commands of low emphasis. -
warninganddangerare for actions that have that meaning themselves. -
danger-secondarystays quiet until hover or focus.danger-ghostis a state that becomes a destructive action, such as Joined, which changes to Leave. - Each settings panel has one recommended action.
- A button with a label has large round corners at each size.
Source Button.svelteactions.css
Fields that agree
Each type of field has one component. The label, the description, and the error are in the same position in each of them.
- A field with focus shows the action colour on its border. An invalid field shows the error colour in the same way. Type a capital letter in the room address.
-
Checkboxis for an independent setting that is on or off.ChoiceRowis for one choice from a short list that stays visible. -
Selectis for a compact choice from a long list.SegmentedControlis for a compact choice of one mode.
Source TextInput.svelteSelect.svelteCheckbox.svelteChoiceRow.svelteSegmentedControl.svelte
Small signals
Small parts tell the user what the state is: a chip, a badge, a bar, a notice.
- A
ToggleChipis a label that the user can switch on and off. - A
Hintis a notice in its context. A plainHintis a short note below a form or an action. A panel is not an alert. -
LoadingDotsshows that content loads. Chatto does not draw rows in the shape of the content that will come.
Source ToggleChip.svelteHint.svelteNotificationBadge.svelteProgressBar.svelteLoadingDots.svelte
Containers
A Panel holds content that stays. It gives the border, the corner radius, and the title, so feature code does not make its own cards.
- A row in a panel uses
surface-box. Do not put a panel in a panel. -
EmptyStateis the placeholder for an empty collection or an empty search result. - A
StatCardshows one number with its label.
The complete system
This page is a selection
mise storybook in the repository.