Tangible Design System · @tangible/ui 0.2.61 · Interactive version · Markdown

Sizing

Size is one axis across the system: a size prop on the component, a tier name (xs, sm, md, lg), and an is-size-* class on its root. The default tier emits no class.

The tiers that matter most are the control heights. Text inputs, selects, buttons, icon buttons and segmented controls all read the same four tokens, so any two controls of the same tier line up in a row, whatever they are, and a host retunes them all with one override.

The control ladder

Tier Token Default Field font size Who uses it
xs --tui-control-height-xs 1.5rem (24px) none Button, IconButton, SegmentedControl only: dense toolbars and table rows. There is no xs form field.
sm --tui-control-height-sm 2rem (32px) --tui-control-font-size-sm → typography-size-sm (14px) Every control. IconButton and Pager default here.
md --tui-control-height-md 2.5rem (40px) --tui-control-font-size-md → typography-size-md (16px) Every control. The default for fields, Button and SegmentedControl.
lg --tui-control-height-lg 3rem (48px) --tui-control-font-size-lg → typography-size-lg (20px) Every control, plus Chip's opt-in lg readout.

The heights sit on an 8px ladder and are written in rem, so they grow with the reader's browser font size. Pixel values above are at the browser default of 16px.

Visual swatches: see the interactive page. Token values are in the primitive token reference.

Each row shows the measured height of every control in it. One number per row means the row lines up. Override the tokens in your own stylesheet and this page follows.

How a control gets its height

Height is a floor, not a formula. Form controls share the control-sizing mixin, which sets three independent things:

Nothing is derived from the font size, so you can change text size and height separately. Button, IconButton and SegmentedControl read the same height tokens directly.

The tokens are never declared on .tui-interface; components only read them, with the ladder value as the fallback. The fallbacks are therefore the real defaults, and every one of them must match the table above. A fallback that drifts ships as a visible misalignment, so the token build reports any that disagree.

Which size type a component takes

Type Tiers Components
SizeStandard sm md lg TextInput, Textarea, Select, MultiSelect, Combobox, MultiCombobox, SearchSelect, CommandPalette, Switch
Size xs sm md lg Button, IconButton, SegmentedControl, plus Progress, StepIndicator and ContentIndicator, which have their own scales
Own scale varies Avatar, IconTile, MoveHandle, Skeleton, Icon; Rating takes sm–lg but sizes its stars, not a box

Only the components that read --tui-control-height-* are on the ladder. Switch takes size but scales its track in em from the font size, Checkbox and Radio size from the surrounding text, and Chip is compact by default.

Retuning heights for a context

Set the tokens on an interface root and every control inside follows, Button and IconButton included:

.my-context .tui-interface {
  --tui-control-height-sm: 32px;
  --tui-control-height-md: 36px;
  --tui-control-height-lg: 44px;

  /* Optional: keep text size steady across tiers */
  --tui-control-font-size-sm: 13px;
  --tui-control-font-size-md: 13px;
  --tui-control-font-size-lg: 14px;
}

This is how Fields matches WordPress admin, Elementor and Beaver Builder. Override all the tiers you use, or sm and md can end up closer together than the ladder intends. The font-size tokens reach fields and SegmentedControl; Button has its own, --tui-button-font-size and --tui-button-font-size-{xs,sm,lg}.

Composing controls

Building a component on the ladder