Overview
The Button component is the primary interactive element in the A’raf Design System. It can render as a<button> or <a> tag automatically depending on whether the href prop is provided.
Installation
Usage
Variants
Button has 7 visual hierarchies reflecting the level of action emphasis.Primary
Used for the primary and most important action on a page. Use sparingly — one per view at most.When to use
- Primary form submission
- Page-level CTA
- Irreversible actions
When not to use
- More than one important action in the same area
- Secondary or tertiary actions
Secondary
Two variants:secondary with a light blue background and secondary-gray with a gray border. Use alongside Primary for alternative actions.
Tertiary
A borderless button that looks like plain text but retains an interactive hit area. Use for tertiary actions that don’t need visual prominence.Link
Appears as a hyperlink. Available in two colors:link-color and link-gray.
Add the
href prop to make this button render as an anchor tag for navigation.Destructive
Red variant for dangerous or permanent actions. Available across all hierarchies.Sizes
5 sizes are available to match different layout contexts.States
Avoid hiding a button when it is unavailable. Use
isDisabled so users can still see the action exists.Icons
Button supports icons on the left, right, or in icon-only mode.As Link
Button renders as an<a> tag simply by adding the href prop.
API Reference
Visual hierarchy of the button. Values:
primary · secondary · secondary-gray · tertiary · tertiary-gray · link-color · link-gray · primary-destructive · secondary-destructive · tertiary-destructive · link-destructiveIcon component rendered to the left of the label. Without
children, the button becomes icon-only.Accessibility
- Uses a semantic
<button>element by default - The
disabledstate is handled with the nativedisabledattribute - Keyboard focus is shown with a
4px #CDE4F5outline ring - Icon-only mode requires an
aria-label - When rendered as a link (
href), full anchor semantics apply
Do’s & Don’ts
Do
- Use Primary for one main action per page
- Pair Primary + Secondary for confirm/cancel actions
- Always add
aria-labelon icon-only buttons - Use the Destructive variant for irreversible actions
Don't
- Don’t use more than one Primary button in the same section
- Don’t use custom colors outside the design system
- Don’t hide a disabled button — use the
isDisabledprop instead - Don’t use the Link variant for actions that modify data