Skip to main content
BEEQ Button component overviewBEEQ Button component overview

Button component overview

Buttons trigger actions in the current context — saving, submitting, confirming, or moving forward in a flow. Use emphasis to communicate priority: each view should have one clear primary action, while secondary actions should be visually lower in emphasis.
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
Use bq-dropdown to open a list of related actions or destinations; a bq-button can be its trigger. Use bq-button on its own for one action. For navigation, set href so the button renders as a link.

Button patterns

Some patterns below are standalone bq-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: 1. Container, 2. Icon, 3. LabelButton anatomy: 1. Container, 2. Icon, 3. Label

Button anatomy

A button can contain a label and optional leading or trailing icons. The label should always communicate the action clearly. Icons should reinforce meaning, not replace it — unless the action is universally understood and an accessible 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.
You don’t need to specify any property that uses its default value. The default appearance is primary with variant standard.
Primary also supports ghost 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 the ghost variant. Renders as an <a> element under the hood when href is provided. Still action-oriented, not for plain navigation.
When using the Link button, always provide a href value.

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. Allowed size values: small, medium (default), large.

Full width

Use the block attribute to make the button stretch to its parent width.

Border radius

Use the border 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, disabledButton states: enabled, hover, focus, active, loading, disabled

Button states: enabled, hover, focus, active, loading, disabled

Disabled

The disabled attribute can be applied to any button variation. When disabled, no interaction is allowed and the bqClick event won’t fire.
Avoid disabled buttons when possible. If an action is unavailable, prefer keeping the button discoverable and explain what is required to proceed.

Loading

Use the loading attribute to indicate something is being processed. Pair with disabled to prevent duplicate actions.

Icons

Leading and trailing icons

Use the prefix or suffix slot to add icons. Icons should reinforce the label — never use them for decoration only.

Only-icon buttons

Use only-icon buttons only for common, easily recognized actions. Always provide a label so assistive technologies can announce the action correctly.
Do not use prefix or suffix slots for icon-only buttons. Pass the icon as the default slot and always set the label prop.

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 label prop to provide a text alternative for assistive technologies.
  • Disabled states — disabled sets aria-disabled="true", removes the control from the Tab order, and prevents activation. Native buttons also receive disabled. Disabled controls are not necessarily hidden from screen readers; you should explain nearby what is required to proceed.
  • Correct semantics — you must omit href for actions and set href for navigation. appearance="link" changes styling only; it does not turn a button into a link.

Keyboard interaction

The component renders a native button, 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