Centrim Design System — a token-first, accessible React component system.
Actions
Actions are where hierarchy matters most. Every screen in this system has exactly one primary action; everything else steps down until it is quiet enough to ignore.
What is this?
The action layer: Button with five weighted variants plus link, IconButton for icon-only controls, and DropdownMenu for overflow. All variants come from CVA maps, so an action's weight is a prop, not a style.
When to use it
- A person can do something: submit, create, export, delete, continue
- A repeated row or toolbar control needs to compress to a single icon
- More than two secondary actions need collecting behind an overflow menu
How to use it
- Choose weight by importance: primary → secondary → tertiary → ghost
- Put the primary action last in a row on desktop, first in stacked mobile order
- Use destructive only for irreversible actions, and confirm them
What to avoid
- Two primary buttons competing in the same view
- An icon-only destructive control with no tooltip or confirmation
- Using a link where a button is needed, or a button where navigation happens
Hierarchy
| Variant | Weight | Use for |
|---|---|---|
| primary | Highest | The single most important action on the screen |
| secondary | High | A close alternative sitting beside the primary |
| tertiary | Medium | Toolbar actions, filters, table controls |
| ghost | Low | Repeated row actions and dense chrome |
| destructive | Highest, negative | Irreversible actions, always confirmed |
| link | Inline | Navigation inside a sentence or a card footer |
Do & don't
Do
- Keep one primary action per view; demote the rest.
- Label actions with a verb and its object: “Create project”, not “Submit”.
- Confirm destructive actions with an AlertDialog before performing them.
- Keep action order stable across similar screens so muscle memory works.
Don't
- Do not restyle a button at the call site to invent a new weight.
- Do not place a destructive action next to the primary action.
- Do not disable a button without telling the person what would enable it.
- Do not use an icon-only button for an action people perform once.
Why it is designed this way
Expressing weight as a variant prop rather than a colour choice is what keeps hierarchy consistent across dozens of screens: reviewers can see “two primaries” in the diff. The required label on IconButton exists because icon-only controls are the most common source of accessibility regressions in dense product UI.