Button component overview
Use a link button for navigation when the intent is to move to another page. See the Link variant.
When to use
Use buttons when
- The user is taking an action in the current context
- The action changes data, state, or progress
- The action needs clear visual priority
Do not use buttons when
- An ordinary text link is enough for navigation
- Several actions compete for equal importance
Button patterns
Some patterns below are standalonebq-button usages, while others are composite interactions built from buttons and related components.
Button
A standard button initiates a single action or event.
Menu Button
Toggles a menu of options without surfacing a primary action.
Split Button
Lets someone take one of several related actions. The dominant action is the label; alternatives are in a menu.
Icon Only
The most compact type, used for supplementary actions like “Bookmark” or “Star.”
Segmented Button
Helps people select options, switch views, or sort elements.
Floating Button
Floating action buttons (FABs) help people take primary actions.
Anatomy
Button anatomy
label prop is provided.
Design guidelines
Choose the button variant based on the importance of the action. Use the strongest visual treatment for the main action in a region. Labels should be short and specific, and several actions should not compete for the same level of emphasis.Usage
appearance defines the base style of the button. variant modifies supported appearances — ghost applies to both primary and secondary buttons, while danger is reserved for destructive actions on the primary appearance.
Primary
The highest priority action in a view. Only one per screen or section. Primary also supportsghost and danger variants:
- Danger: reserved for actions that may result in critical or irreversible consequences, such as deleting important data or confirming a high-risk operation.
- Ghost: a more subtle style for secondary or less prominent actions that don’t require immediate attention.
Secondary
Lower-emphasis actions. Can stand alone or pair with a primary button to perform secondary actions. Supports theghost variant.
Link
Renders as an<a> element under the hood when href is provided. Still action-oriented, not for plain navigation.
Text
No background or border. Suitable for inline actions, subtle calls to action, or options within a form.Options
Size and shape
Sizes
Choose the size that best matches the context. Medium is the default and should be the size for most interfaces. Allowedsize values: small, medium (default), large.
Full width
Use theblock attribute to make the button stretch to its parent width.
Border radius
Use theborder property to control the corner radius.
Allowed border values: none, xs2, xs, s, m (default), l, full.
States
For each button appearance and variant, there are six visual states: enabled, hover, focus, active, loading and disabled.Button states: enabled, hover, focus, active, loading, disabled
Disabled
Thedisabled attribute can be applied to any button variation. When disabled, no interaction is allowed and the bqClick event won’t fire.
Loading
Use theloading attribute to indicate something is being processed. Pair with disabled to prevent duplicate actions.
Icons
Leading and trailing icons
Use theprefix or suffix slot to add icons. Icons should reinforce the label — never use them for decoration only.
Only-icon buttons
Useonly-icon buttons only for common, easily recognized actions.
Always provide a label so assistive technologies can announce the action correctly.
Content guidelines
Label guidelines
Best practices
DoKeep button labels succinct — 1 or 2 words, no longer than 4, under 20 characters.
Don’tNever let button labels wrap to multiple lines or lose their button shape.
DoPair a primary button with a secondary button for alternative actions.
Don’tDon’t place multiple primary buttons together — it dilutes the visual hierarchy.
DoKeep emphasis aligned with task priority — one primary action per view.
Don’tDon’t use icons as decoration. Every icon should reinforce the label meaning.
DoUse icon-only buttons only when the action is familiar and the
label prop provides an accessible name.Don’tDo not rely on an icon alone when the action is uncommon, destructive, or easy to misunderstand.
Accessibility
- Use descriptive labels — buttons must have descriptive labels so users know what will happen, which reduces errors and increases confidence.
- Icon-only buttons — you must set the
labelprop to provide a text alternative for assistive technologies. - Disabled states —
disabledsetsaria-disabled="true", removes the control from the Tab order, and prevents activation. Native buttons also receivedisabled. Disabled controls are not necessarily hidden from screen readers; you should explain nearby what is required to proceed. - Correct semantics — you must omit
hreffor actions and sethreffor navigation.appearance="link"changes styling only; it does not turn a button into a link.
Keyboard interaction
The component renders a nativebutton, or a native a when href is set.
A disabled or
loading button does not emit bqClick or act on the form. Space does not activate a link rendered with href.
Rules
API reference
Properties
Invalid combinations
Events
- In React, prefix events with
on:onBqClick,onBqFocus,onBqBlur. - In Angular, use the event binding syntax:
(bqClick),(bqFocus),(bqBlur). - In Vue, use the
@shorthand:@bqClick,@bqFocus,@bqBlur.
Slots
Shadow parts
CSS custom properties
Resources
Interactive playground
Explore all button configurations in Storybook
Source code
View the component source on GitHub