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
- The user is navigating to another page with no side-effect
- Several actions compete for equal importance
- A text link is sufficient
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, keep labels short and specific, and avoid making several actions 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 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 preferred size for most interfaces.Full width
Use theblock attribute to make the button stretch to its parent width.
Border radius
Use theborder property to control the corner radius.
States
For each button appearance and variant, there are five 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.
Icon-only buttons
Use icon-only buttons only for common, easily recognized actions. Always provide alabel 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 — labeling buttons properly lets users know what will happen, reduces errors, and increases confidence.
- Icon-only buttons — always set the
labelprop to provide a text alternative for assistive technologies. - Keyboard navigation — buttons are focusable and activated with Enter or Space by default.
- Avoid disabled states — disabled buttons are invisible to screen readers. Where possible, keep the button discoverable and explain what is required to proceed.
- Correct semantics — use
<bq-button>for actions and links for navigation.
API reference
Properties
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