Skip to content
中文

Button

A button that triggers an action. One primary button per screen.

Demo

Usage

Use <button class="hao-btn">; you provide the text, and it says clearly what a press does (“Save changes”, not “OK”).

ClassWhere to use it
hao-btnThe primary button, filled with tint. One per screen.
hao-btn--tintedSecondary actions, on a tint-wash ground.
hao-btn--plainEscapes like Cancel and Skip, or a second place to go beside the primary button; text only.
hao-btn--sealIrreversible actions such as Delete. It counts as the screen’s one touch of cinnabar—no seal on the same screen.
hao-btn--smA small capsule inside a list row, 32px tall; leave a full 44px touch target around it.
hao-btn--blockFills the container’s width, at the foot of a form.
  • Never stand two primary buttons side by side.
  • Button text stays on one line, no more than three words (six characters in Chinese).
  • When a button is disabled, add the disabled attribute and say nearby why it can’t be pressed. A disabled button is gray on gray—not a dimmed primary button—so it doesn’t read as the secondary kind.
  • When a press means waiting, add aria-busy="true": a small ring appears in front of the button, the text turns to its progressive form (“Saving”), and the button can’t be pressed again while it works. When it’s done, a toast says “Saved”.
  • Buttons keep a minimum width of 88px (64px small), so a two-character button still carries enough weight; plain text buttons set no minimum.