Skip to main content
ALEXY LINK

Dropdown 08

A persistent workspace switcher — the active workspace stays checked among its peers, with a dedicated action for creating a new one.

Requirements

HTML, CSS, JavaScript

Dependencies

None

Usage

Copy index.html, styles.css and script.js into your project.

Typography: Inter, with a system sans-serif fallback.

About Dropdown 08

Dropdown 08 is a dropdown component in the Dropdown Components collection, available in HTML + CSS + JavaScript and React + TypeScript + Tailwind CSS. Last updated September 13, 2026.

  • dropdown
  • workspace switcher

What the code includes

HTML + CSS + JavaScript

3 files: index.html, styles.css, script.js

  • Behavior is handled in script.js.
  • ARIA in the markup: roles menu, menuitemradio, separator, menuitem; aria-haspopup, aria-expanded, aria-label, aria-checked.
  • HTML elements used: button, svg.
  • Keyboard keys handled: Escape, ArrowUp, ArrowDown, Tab.
  • Includes a prefers-reduced-motion rule for its animation.

React + TypeScript + Tailwind CSS

3 files: Dropdown08.jsx, Dropdown08.types.ts, Dropdown08.tailwind.css

  • Configurable through 7 props: workspaces, value, defaultValue, onValueChange, onCreateWorkspace, defaultOpen, className.
  • Uses React hooks: useEffect, useId, useLayoutEffect, useRef, useState.
  • ARIA in the markup: roles menuitemradio, option, menuitem, menu, separator; aria-checked, aria-haspopup, aria-expanded, aria-controls, aria-label.
  • HTML elements used: button, svg.
  • Keyboard keys handled: Escape, Enter, ArrowUp, ArrowDown, Tab.
  • Includes a prefers-reduced-motion rule for its animation.
View all Dropdown Components (10)