1. Home
  2. Foundations
  3. Interaction states

Every control shows its state in the same few ways, so a person learns them once. Kanso takes Material Design's state layers and adds one rule: a state never rests on colour alone.

The states

StateHow it shows
RestThe control's own fill and label.
HoverA layer of the content colour at 8%.
FocusA 2px ring in kui-color-focus-ring, 2px outside the control, plus the layer at 10%.
PressedA layer at 12%; buttons tighten their corners.
SelectedInk fill with on-ink (chips, the navigation pill), or a lifted surface with an outline (segments), or an ink bar (tabs, the pane's selection bar). The label also turns bold.
CheckedInk fill with a check (checkboxes), an ink dot (radios), an ink track with a bigger thumb (switch).
DisabledFill in ink at 12%, label at 38%; no state layers. Say why nearby.
ErrorA 2px critical border, an error icon and a message under the field.
LoadingA spinner or a progress bar in place of the result, with its label read out. Button's isPending keeps the button's width and marks it busy.

The tokens

Kanso's layers are kui-state-layer-opacity-kanso-hover (8%), -kanso-focus (10%) and -kanso-pressed (12%), with -kanso-disabled-container (12%) and -kanso-disabled-content (38%). The components draw Material Design's today, kui-state-layer-opacity-hover (8%), -focus (10%), -pressed (10%) and -dragged (16%), with the same disabled values, and take Kanso's pressed layer with each family's release.

Under forced colours the system drops shadows and paints backgrounds in system colours, so every focus ring and every control boundary in Kanso UI is a border or an outline: a control keeps its edge and its ring in the mode where they matter most.

Rules

  • Do keep focus visible on every surface: inside the spotlight the ring is on-spotlight, on ink fills it is on-ink.
  • Do show selection in at least two ways (fill and weight, or fill and a bar), so it survives grayscale and forced colours.
  • Do prefer hiding an action that can't happen to disabling it, unless its presence teaches something.
  • Don't change a control's size or position on hover; only the layer changes.
  • Don't use hover for anything essential: touch screens never hover.