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
label prop is provided.
| Part | Element | Description |
|---|---|---|
| 1 | Container | The interactive surface wrapping all content |
| 2 | Icon | Optional prefix or suffix slot content |
| 3 | Label | The primary communicator of the action |
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.| Size | When to use |
|---|---|
| Small | When space is limited or the action is less significant |
| Medium | Default — suitable for most interfaces |
| Large | To increase the significance of an action; use sparingly |
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.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
| Guideline | Rule |
|---|---|
| Be concise | 1–2 words, max 4 words, under 20 characters. No punctuation. |
| Use verbs | Labels should describe the action: “Save”, “Delete”, “Submit” — not nouns or adjectives. |
| Sentence case | Never use ALL CAPS to emphasize a button. |
| No wrapping | Labels must never break to multiple lines. |
| No emoji | Keep labels functional and utilitarian. No emoji or exclamation points. |
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
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
appearance | appearance | The appearance style to apply to the button | 'primary' | 'secondary' | 'link' | 'text' | 'primary' |
block | block | If true, makes the button fit to its parent width | boolean | false |
border | border | The corner radius of the button | 'none' | 'xs2' | 'xs' | 's' | 'm' | 'l' | 'full' | 'm' |
disabled | disabled | If true, the button will be disabled | boolean | false |
download | download | Tells the browser to treat the linked URL as a download. Only used when href is set | string | undefined |
href | href | When set, renders an <a> instead of a <button> | string | undefined |
justifyContent | justify-content | How the content should be aligned | 'left' | 'center' | 'right' | 'center' |
label | label | Accessible label for screen readers, especially for icon-only buttons | string | undefined |
loading | loading | If true, displays the button in a loading state | boolean | false |
onlyIcon | only-icon | If true, renders the button as icon-only with 1:1 aspect ratio | boolean | false |
size | size | The size of the button | 'small' | 'medium' | 'large' | 'medium' |
target | target | Where to display the linked URL | '_blank' | '_parent' | '_self' | '_top' | undefined |
type | type | The default behavior of the button | 'button' | 'submit' | 'reset' | 'button' |
variant | variant | The variant on top of appearance (primary and secondary only) | 'standard' | 'ghost' | 'danger' | 'standard' |
Events
| Event | Description | Type |
|---|---|---|
bqBlur | Fires when the button loses focus | CustomEvent<HTMLBqButtonElement> |
bqFocus | Fires when the button receives focus | CustomEvent<HTMLBqButtonElement> |
bqClick | Fires when the button is clicked | CustomEvent<HTMLBqButtonElement> |
- 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
| Slot | Description |
|---|---|
| (default) | The button label content |
prefix | Content displayed before the button label |
suffix | Content displayed after the button label |
Shadow parts
| Part | Description |
|---|---|
button | The native <button> or <a> element |
label | The <span> rendering the button text |
prefix | The prefix container |
suffix | The suffix container |
CSS custom properties
Resources
Interactive playground
Explore all button configurations in Storybook
Source code
View the component source on GitHub