Skip to content

Icon Button

Use bq-icon-button for compact icon-only actions such as refresh, close, open-menu, favorite, or toolbar controls.

Basic Usage

html
<bq-icon-button label="Open filters">
  <span aria-hidden="true">☰</span>
</bq-icon-button>

Title Fallback

If you already need a tooltip-like title, you can use title as the accessible-name fallback when label is omitted. If both are provided, label remains the primary accessible name.

html
<bq-icon-button title="Refresh results">
  <span aria-hidden="true">↻</span>
</bq-icon-button>

Loading State

html
<bq-icon-button label="Sync data" loading>
  <span aria-hidden="true">⟳</span>
</bq-icon-button>

Loading icon buttons expose aria-busy="true" and attach a localized status description without changing the control's accessible name.

html
<bq-icon-button
  href="https://example.com/settings"
  label="Open settings"
  title="Settings"
>
  <span aria-hidden="true">⚙</span>
</bq-icon-button>

Properties

PropertyTypeDefaultDescription
variantprimary | secondary | outline | ghost | dangerghostVisual style
sizesm | md | lgmdButton size
disabledbooleanfalseDisables interaction
loadingbooleanfalseShows spinner and disables interaction
labelstringPreferred accessible label for the control
titlestringOptional tooltip and accessible-name fallback
hrefstringRenders as <a> when set

Events

EventDetailDescription
bq-click{ originalEvent: MouseEvent }Fired on click when not disabled/loading

Slots

SlotDescription
(default)The icon content

CSS Parts

PartDescription
buttonThe inner <button> or <a> element

Accessibility Notes

  • Prefer label as the explicit accessible name. When label is omitted, title is used as the fallback name before the component falls back to a localized generic label.
  • If neither label nor title is provided, the component falls back to a localized generic label so the control never becomes unnamed.
  • Mark decorative icon content with aria-hidden="true" so screen readers announce only the control label.
  • Prefer bq-button when the action should show visible text.

Released under the MIT License.