Magoo Component UI logo Magoo Component UI
← Catalog

Version Selector

version-selector molecule experimental

A compact dropdown for switching between doc or API versions, with Latest/Beta badges and a check on the current one.

Also in: Navigation

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
Open

Props

NameTypeReq
label string
current string ✓
versions array ✓
start_open boolean

Related components

How to use

Open state is the root's data-open attribute, and the menu is revealed purely by CSS (group-data-[open=true] flips it from invisible/opacity-0/pointer-events-none to visible), so it works under Drupal's unlayered stylesheets and previews open via the start_open prop. behavior.js wires the toggle (updates data-open and the trigger's aria-expanded), option selection (moves the check, updates the trigger's version text, dispatches a bubbling version:pick event with detail.value, and closes), and closing on Escape or an outside click; ArrowUp/Down move focus between options. The portable self-init reads everything from the DOM - no props object is passed.

Use cases

nav WCAG AA SEO 25 dir: ltr ai-generated