Skip to content

Sizing

How tall controls are as shipped, which sizes to pair, and how to size a screen or a region for fingers with touch-controls.

Sizing in Silkware is the sizing of the upstream shadcn components: a control has one of four heights, and every control that sits beside another shares the same default. Those sizes hold on every device. Where a screen or a part of it is meant for fingers, you switch it to touch sizing with one class, touch-controls, and its controls reach 44px.

Control sizes as shipped

SizeHeightButtonIcon buttonAlso
xs24px (h-6)size="xs"size="icon-xs"Icons shrink to 12px.
sm32px (h-8)size="sm"size="icon-sm"SelectTrigger with size="sm".
default36px (h-9)size="default"size="icon"Input, select, tabs list, toggle row.
lg40px (h-10)size="lg"size="icon-lg"

Inputs, selects and the default button are all 36px, so a search field and its button align without extra classes. A badge is 20px (h-5). Checkboxes and radios are 16px.

Pair like with like: keep one size in a group of controls and one size per toolbar.

Do

Keep one size in a group of buttons.

Don’t

Don’t pair an extra small and a large button.

Touch controls

The shipped sizes meet the WCAG 2.2 AA target size (24px, or enough space around a smaller target) on every device, so nothing grows by itself. The brand asks for 44px where a finger is the pointer. Put touch-controls on a control, a region or a whole screen, and that element and everything inside it switch to touch sizing.

As shipped

With touch-controls

Inside a touch-controls scopeWhat happens
Button, input, select, tab, menu item, pagination, sidebar item, linkGrows to 44px tall. Buttons, tabs and links are at least 44px wide too.
Icon button on its ownGrows to 44 by 44px.
A row with a checkbox, radio or switchThe row is 44px, so choices do not crowd each other.
Checkbox, radio, switch, slider thumb, toggleKeeps its look. An invisible hit area around it is 44px.
Close icon of a dialog or sheet, a button inside an input group, carousel arrows, copy buttonsKeeps its look and place, with a 44px hit area.
CalendarDay cells grow to 44px. A month is 332px wide.
Link in a sentenceUnchanged. Inline links are exempt, as in WCAG.

Choose the condition

The class takes any Tailwind variant, so you decide when it applies.

ClassUse it for
pointer-coarse:touch-controlsA screen used with a mouse and on phones, such as sign-in or a form. Fingers get 44px, a mouse keeps the density. The usual choice.
touch-controlsA region that only exists in the phone layout, such as a mobile menu sheet, or a surface that is only ever touched.
max-md:touch-controlsA region that turns into its phone form below a breakpoint, such as the sidebar while it is a sheet.
touch-controls-offA part of a scope that stays compact: filter chips, a dense table, inline controls.

The two buttons above carry no size class. Their wrapper has touch-controls, so both are 44px tall.

The chips sit in a touch-controls-off list inside the scope, so they keep their compact size while the action below is 44px.

  • Menus, selects, popovers, dialogs and sheets open outside the page, so they do not inherit a scope. Put the class on their content as well: SelectContent, DropdownMenu, Sheet, AlertDialog.
  • Do not add h-11 or size-11 to reach 44px. Use touch-controls, which keeps the size in one token and keeps a mouse layout as shipped.
  • A class you put on a control still wins inside a scope: min-h-8 makes it 32px.
  • Change the size with --touch-target in app/globals.css or the theme editor: 3rem matches Android's 48dp. Never set it below 1.5rem, the WCAG minimum.
  • Text fields are 16px on a touch screen in every case, scope or not, so iOS does not zoom in when one takes focus.