Components
Button
Buttons trigger an action or event, such as submitting a form, opening a dialog, or performing a destructive action.
Stable
GitHubAnatomy
Anatomy
import {Button} from '@staffbase/design';
<Button />;Examples
Variants
Colors
With icons
Icon only
With tooltip
As a link
API reference
Button
| Name | Type | Description |
|---|---|---|
children | ReactNode | The content of the button. Can be text, icons, or both. |
variant | solidoutlineghost | The visual style of the button. Default: solid |
color | primaryneutralcritical | The color scheme of the button. Default: primary |
iconOnly | boolean | Makes the button square with even padding, for icon-only buttons. Pair with aria-label for accessibility. Default: false |
When to use
When not to use
How to use
Structure
Variants
Do
Nonumy Eirmod TemporConsetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt (…)
Ghost button on a plain surface.
Don't
Sadipscing Elitr Sed InviduntCamm nonumy eirmod tempor invidunton setetur sadipscing, sed (…)
Ghost button on a busy background.
Colors
| Color | Meaning / use |
|---|---|
| The main action of a screen, dialog, or section, such as Save or Publish | |
| Supporting and dismissive actions, such as Cancel, Back, or Close | |
| Destructive actions that are permanent or hard to undo, such as Delete or Remove |
Hierarchy & grouping
Do
One primary action, supported by lower-emphasis buttons.
Don't
Two primary buttons compete for attention.
Icon & label
Do
Icons only where they add meaning.
Don't
An icon on every button as decoration.
More Actions
States
Links
Accessibility
Content & UX copy
Do
Specific, Title Case action labels.
Don't
Vague, shouted, or over-long labels.