Skip to main content
BEEQ Option component overview
bq-option is a single selectable item inside a list-based UI control such as a dropdown, select, or navigation menu. It manages its own focused, selected, and disabled states, and communicates user interactions back to the parent through events.
bq-option must always be placed inside a bq-option-list, which provides the required role="listbox" context. Rendering an option outside a list breaks the ARIA relationship expected by assistive technologies.

When to use

Use options when
  • You need a single selectable item inside a dropdown, select, or menu
  • The item requires a text label with optional prefix or suffix icons to add clarity
  • The choice should be individually disableable without removing it from the list

Do not use options when
  • You need a standalone interactive control — use bq-button or bq-checkbox instead
  • The action is destructive and needs confirmation — surface it as a dialog or separate form element, not a list item
  • The item will be displayed outside a bq-option-list context

Option patterns

Label only

The simplest form — a text label with no icon. Use for compact menus where space is limited and the labels are self-explanatory.

Prefix icon + label

An icon to the left of the label visually categorizes the item. Use when the list contains many entries and users benefit from a quick visual scan.

Label + suffix icon

An icon to the right of the label signals a secondary function — such as an external link, a shortcut key, or a status indicator. Use sparingly so it does not compete with the primary label.

Anatomy

BEEQ Option component anatomy
Each option is a button-like surface with an optional prefix icon, a label, and an optional suffix icon. The three parts are spaced via dedicated CSS custom properties.
PartElementDescription
1PrefixOptional slot for an icon or element rendered before the label
2LabelThe main text content of the option
3SuffixOptional slot for an icon or element rendered after the label

Design guidelines

States

bq-option manages hover, focus, selected, and disabled styles automatically via internal CSS. You do not need to apply classes or attributes for these visual states — set the selected and disabled props and the component handles the rest.

Icon placement

Place prefix icons when the list is long and icon-based scanning helps users find the right item quickly. Reserve the suffix slot for secondary information — an arrow indicating an external link, a keyboard shortcut, or a status badge — that does not compete with the label.
1

Prefix only

The most common pattern. One icon on the left anchors the visual rhythm of the list and speeds up scanning.
2

Suffix only

Use when the right-aligned indicator is the primary reason for the icon — for example, a link-out arrow that tells users this option opens a new page.
3

Prefix and suffix

Acceptable for rich option lists where both a category icon (prefix) and a status indicator (suffix) genuinely add value. Avoid overusing this combination — it can make the list feel dense.

Usage

Default

A simple list of options inside a bq-option-list. Each option carries a value attribute used by the parent to identify which item the user selected.

With prefix icon

Add a bq-icon in the prefix slot to give each item a visual anchor. Icons make longer lists easier to scan and help users recognize options without reading every label.

With suffix icon

Use the suffix slot for a right-aligned secondary indicator. Common uses include link-out arrows, keyboard shortcuts, or status icons.

Options

Selected state

Set selected on the option that reflects the current active value. The component applies the brand accent styling automatically.

Disabled state

Set disabled on individual options to mark them as contextually unavailable. Disabled options remain visible in the list but do not respond to clicks or keyboard events.

Hidden state

Set hidden on an option to remove it from the visible list and the accessibility tree while keeping it in the DOM. Unlike disabled, a hidden option is completely invisible — screen readers skip it and it cannot be focused. Use this for options that are programmatically toggled based on application state.
To organize options into labeled sections, wrap bq-option elements in bq-option-group and place the groups inside a bq-option-list. The Option Group page has full code examples including header prefix and suffix customization.

Best practices

DoAlways provide a value attribute on each option so the parent component can identify which item was selected.

Don’tOmit the value attribute. Without it, the parent bq-option-list or select-like component cannot distinguish which option the user chose.

DoUse disabled for options that are temporarily unavailable in the current context — keeping them visible signals that the feature exists.

Don’tUse hidden as a permanent way to remove an option. If an option is never relevant for the user, remove it from the DOM entirely instead.

DoKeep option labels short and descriptive — one to four words that clearly identify the action or destination.

Don’tWrite long sentences as option labels. Long labels break the visual rhythm of the list and make scanning harder.

DoUse consistent icon placement across all options in the same list — either all with prefix icons or all without.

Don’tMix options with icons and options without icons in the same list — the uneven spacing makes the list look misaligned.

Accessibility

bq-option sets role="option" on its host element automatically. It also manages the following ARIA attributes based on its props:
  • aria-selected="true" is set when selected is true, communicating the active choice to screen readers.
  • aria-disabled is always present on the host. It is set to "true" when disabled or hidden is true, and to "false" otherwise, ensuring assistive technologies always have the correct interactive state.
  • aria-hidden="true" is set when hidden is true, removing the item from the accessibility tree entirely.
As a developer, you are responsible for:
  • Placing options inside bq-option-list — the role="option" on each item requires a role="listbox" ancestor, which bq-option-list provides. Rendering options outside this context breaks the ARIA relationship.
  • Providing meaningful labels — the text inside the default slot is read by screen readers as the option’s accessible name. Avoid icon-only options; always include a visible text label.
  • Keyboard navigationbq-option listens for Enter keydown and emits bqEnter. The parent bq-option-list handles ArrowUp/ArrowDown focus management. Do not intercept these keys in your own handlers unless you are building a custom container.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
disableddisabledIf true, the option is disabledbooleanfalse
displayValuedisplay-valueOverrides the default displayed value of the optionstring
hiddenhiddenIf true, the option is hiddenbooleanfalse
selectedselectedIf true, the option is selected and activebooleanfalse
valuevalueA string used to identify the optionstring

Events

EventDescriptionType
bqBlurEmitted when the option loses focusCustomEvent<HTMLBqOptionElement>
bqClickEmitted when the option is clickedCustomEvent<HTMLBqOptionElement>
bqEnterEmitted when Enter is pressed while the option is focusedCustomEvent<HTMLBqOptionElement>
bqFocusEmitted when the option receives focusCustomEvent<HTMLBqOptionElement>

Slots

SlotDescription
(default)The label text content of the option
prefixContent rendered before the label — typically a bq-icon
suffixContent rendered after the label — typically a bq-icon

Shadow parts

PartDescription
baseThe internal <button> wrapper of the option
labelThe <span> element containing the label text
prefixThe <span> element wrapping the prefix slot content
suffixThe <span> element wrapping the suffix slot content

CSS custom properties

Resources

Interactive playground

Explore option variants and states in Storybook

Source code

View the component source on GitHub