Documentation Index
Fetch the complete documentation index at: https://araf.badr.co.id/llms.txt
Use this file to discover all available pages before exploring further.
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.| Size | Prop | Height | Use case |
|---|---|---|---|
| Small | sm | 36px | Tables, dense toolbars |
| Medium | md | 40px | Default — forms, cards, dialogs |
| Large | lg | 44px | Hero sections, landing pages |
| Extra Large | xl | 48px | Marketing pages |
| 2X Large | 2xl | 56px | Full-width CTAs, splash screens |
States
| State | Prop | Description |
|---|---|---|
| Default | — | Normal appearance |
| Hover | — | Background becomes #045CA0, handled automatically |
| Focused | — | Ring 4px #CDE4F5 for keyboard navigation |
| Disabled | isDisabled | Opacity 0.4, cursor not-allowed |
| Loading | isLoading | Spinner scales to match button size and color |
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-destructiveButton size. Values:
sm · md · lg · xl · 2xlDisables interaction and applies the disabled visual state.
Shows a loading spinner and prevents interaction.
When
true, the children text remains visible during isLoading.Icon component rendered to the left of the label. Without
children, the button becomes icon-only.Icon component rendered to the right of the label.
When provided, the button renders as an
<a> anchor tag.Additional Tailwind classes for custom overrides.
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