Actions
Button
Trigger actions with haptic feedback, ripple effects, loading states, and icon support.
Basic Usage
The standard button for primary and secondary actions.
Variants
Sizes
Five sizes for different layout priorities.
With Icons
Support for icons on either side.
States
Loading and disabled states.
Icon-Only
Square icon buttons for toolbars and tight spaces. Always add aria-label.
Loading States
Show custom text while loading with loadingText.
Render as Link
Pass href to render the button as a semantic anchor element. It still supports onClick, haptics, and ripple effects.
Events
Standard event handlers like onClick work as expected, even with haptic and motion layers.
Real-world Scenario: Auth Action
Combining loading states, icons, and badges for a premium authentication or action flow.
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | Main descriptive text or overlay children layout |
size | BiibaSize | 'md' | Visual scale of the button |
variant | BiibaVariant | 'link' | 'danger' | 'primary' | Color and style variant |
loading | boolean | false | Shows a spinner and disables interaction |
disabled | boolean | false | If true, disables all user interaction and applies faded opacity |
fullWidth | boolean | false | Stretches to fill parent width |
pill | boolean | false | Fully rounded pill shape |
iconOnly | boolean | false | Removes padding for icon-only square button |
leftIcon | React.ReactNode | — | Icon rendered to the left of children |
rightIcon | React.ReactNode | — | Icon rendered to the right of children |
loadingIcon | React.ReactNode | — | Override the icon used in the loading state |
loadingText | string | — | Text shown while loading (replaces children) |
hapticFeedback | boolean | true | Enable haptic feedback on mobile |
as | 'button' | 'a' | — | Render as anchor tag |
href | string | — | URL address of the link. Renders as text if omitted |
target | string | — | Target for anchor rendering |
rel | string | — | Link relationship metadata |
aria-label | string | — | Accessible label for icon-only buttons |
badge | React.ReactNode | — | Content rendered in a small circle at the top-right of the button |