When to use
- To start an action on the current screen: save, submit, test a connection, run a sync, delete.
- To open a dialog or a drawer, or to start a flow.
- To confirm or cancel in a dialog.
When not to use
- To go to another page. Use a link; if it must look like a button, use an
aelement with the button classes. - For a setting that takes effect at once. Use a switch.
- For more than three related actions in one place. Keep the main one as a button and put the rest in a menu.
- To choose one value from a list. Use a select.
Anatomy
| Part | Required | Notes |
|---|---|---|
| Container | Yes | Fill and edge set the emphasis. Subtle buttons have no fill until hover. |
| Label | Yes, except icon-only | Sentence case, starts with a verb, one line. |
| Icon | No | Before the label, size.icon.default (16 px), space.control.gap from the label. |
| Trailing icon | No | Only an external-link icon or a menu chevron. |
| Focus ring | Yes | border.width.focused in color.border.focus, state.focus.offset away. Never removed. |
Variants
Pick the emphasis first, then the tone.
| Variant | Use it for | Colours |
|---|---|---|
| Primary | The one main action in a screen or a dialog | color.background.primary with color.text.inverse |
| Default | Most actions, and every other action next to a primary one | color.surface, color.border, color.text |
| Subtle | Toolbars, table rows, card headers, and “Cancel” next to a primary button in a drawer | Transparent at rest; color.background.neutral.transparent.hover and .pressed |
| Danger | Confirms an action that deletes data or can’t be undone | color.background.danger.bold with color.text.on-bold |
| Danger tone on subtle | A destructive action in a row or list, such as “Remove” | color.text.danger; color.background.danger.subtle.hover and .pressed |
Combinations in one group:
| Combination | Allowed |
|---|---|
| One primary with default or subtle buttons | Yes |
| Danger with a default “Cancel” | Yes, in a confirmation dialog |
| Two primary buttons | No. If several actions are equally important, make them all default |
| Primary and danger together | No. In a confirmation, the danger button is the main action |
| Buttons of different sizes | No |
| Icons on some buttons only | No. All buttons in a group have an icon, or none do |
Sizes
The button is as tall as the fields beside it, so a row of filters and actions lines up.
| Size | Height | Side padding | Label | Where |
|---|---|---|---|---|
| Small | size.control.small, 24 px |
space.control.x.small |
font.label.small |
Dense tables, their toolbars, filter bars |
| Default | size.control.default, 32 px |
space.control.x |
font.label.default |
Everywhere else |
| Large | size.control.large, 40 px |
space.control.x.large |
font.label.default |
Sign-in and onboarding pages; the main action on phones |
Every size keeps a target of at least 24 × 24 px; on touch screens the tap area grows to 44 × 44 px (size.target.touch). An icon-only button is a square of the same height.
States
| State | What changes |
|---|---|
| Rest | The variant’s colours |
| Hover | Fill one step up: .hover tokens |
| Pressed | Fill two steps up: .pressed tokens. Label, icon and edge keep their colours |
| Focus | The focus ring, on :focus-visible only |
| Loading | Colours stay; a spinner replaces the icon; the label says what is happening (“Syncing…”); clicks are ignored; aria-busy="true" |
| Unavailable | Disabled colours, but still focusable with aria-disabled="true", and the reason is shown next to it |
| Disabled | color.background.disabled, color.border.disabled, color.text.disabled; removed from the tab order |
Disabled uses colours, never transparency. See Interaction states.
Unavailable actions
A greyed-out button that gives no reason leaves people stuck. In order of preference:
- Keep the button active, and when it is pressed, show what is missing (for example, the empty required field).
- Show it as unavailable with
aria-disabled="true"and write the reason next to it: “Connect an online store first.” - Use native
disabledonly for a short wait the user already understands, such as while a form loads.
Don’t put the reason only in a tooltip on a disabled button: keyboard users can’t reach it.
Placement and order
- Dialogs, drawers, wizard footers: buttons at the end of the row; the primary button last. “Cancel” or “Back” comes before it.
- Page forms: buttons at the start, under the last field; the primary button first.
- Toolbars and table rows: subtle buttons, small size in dense tables.
- Space buttons in a row with
space.100.
Width and long labels
- A button is as wide as its label. Use full width only in narrow panels and on phones.
- Never cut a label with an ellipsis: the action becomes unclear. Shorten the label instead. Vietnamese labels are often longer than English ones, so check both.
Writing the label
- Start with a verb and name the object: “Sync orders”, “Add mapping”, “Delete connection”.
- Sentence case, no full stop, no “OK”, “Yes” or “Submit”.
- In a dialog, the button answers the title: “Delete this connection?” → Delete and Cancel.
- Use the same verb for the same action everywhere:
| Action | English | Vietnamese |
|---|---|---|
| Keep changes | Save | Lưu |
| Stop without keeping changes | Cancel | Hủy |
| Close a panel that changes nothing | Close | Đóng |
| Make something new | Create | Tạo |
| Put an existing item into a list | Add | Thêm |
| Take out of a list, keep the item | Remove | Gỡ |
| Destroy the item | Delete | Xóa |
| Link two systems | Connect | Kết nối |
| Copy data between systems | Sync | Đồng bộ |
| Move through steps | Next, Back | Tiếp, Quay lại |
| End a flow | Done | Xong |
Related buttons
| Need | Use |
|---|---|
| An action in a tight place, or close and copy | Icon button |
| Two or three buttons together | Button group |
| Several related actions behind one button | Menu button |
| A default action with alternatives | Split button |
| A mode that stays on or off | Toggle button |
| One option out of two to five | Segmented control |
| Tools for a canvas or editor | Toolbar |
| Actions on selected rows | Action bar |
A link that looks like a button is the Link variant of this component. Beehexa has no floating action button: products are desktop-first and no screen needs one.