Skip to main content
BEEQ 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
  • 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 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. Label
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.
PartElementDescription
1ContainerThe interactive surface wrapping all content
2IconOptional prefix or suffix slot content
3LabelThe 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.
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 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 preferred size for most interfaces.
SizeWhen to use
SmallWhen space is limited or the action is less significant
MediumDefault — suitable for most interfaces
LargeTo increase the significance of an action; use sparingly

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.

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

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.

Icon-only buttons

Use icon-only 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

GuidelineRule
Be concise1–2 words, max 4 words, under 20 characters. No punctuation.
Use verbsLabels should describe the action: “Save”, “Delete”, “Submit” — not nouns or adjectives.
Sentence caseNever use ALL CAPS to emphasize a button.
No wrappingLabels must never break to multiple lines.
No emojiKeep 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 label prop 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

PropertyAttributeDescriptionTypeDefault
appearanceappearanceThe appearance style to apply to the button'primary' | 'secondary' | 'link' | 'text''primary'
blockblockIf true, makes the button fit to its parent widthbooleanfalse
borderborderThe corner radius of the button'none' | 'xs2' | 'xs' | 's' | 'm' | 'l' | 'full''m'
disableddisabledIf true, the button will be disabledbooleanfalse
downloaddownloadTells the browser to treat the linked URL as a download. Only used when href is setstringundefined
hrefhrefWhen set, renders an <a> instead of a <button>stringundefined
justifyContentjustify-contentHow the content should be aligned'left' | 'center' | 'right''center'
labellabelAccessible label for screen readers, especially for icon-only buttonsstringundefined
loadingloadingIf true, displays the button in a loading statebooleanfalse
onlyIcononly-iconIf true, renders the button as icon-only with 1:1 aspect ratiobooleanfalse
sizesizeThe size of the button'small' | 'medium' | 'large''medium'
targettargetWhere to display the linked URL'_blank' | '_parent' | '_self' | '_top'undefined
typetypeThe default behavior of the button'button' | 'submit' | 'reset''button'
variantvariantThe variant on top of appearance (primary and secondary only)'standard' | 'ghost' | 'danger''standard'

Events

EventDescriptionType
bqBlurFires when the button loses focusCustomEvent<HTMLBqButtonElement>
bqFocusFires when the button receives focusCustomEvent<HTMLBqButtonElement>
bqClickFires when the button is clickedCustomEvent<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

SlotDescription
(default)The button label content
prefixContent displayed before the button label
suffixContent displayed after the button label

Shadow parts

PartDescription
buttonThe native <button> or <a> element
labelThe <span> rendering the button text
prefixThe prefix container
suffixThe suffix container

CSS custom properties

Resources

Interactive playground

Explore all button configurations in Storybook

Source code

View the component source on GitHub