Your next page is taking shape...

Opening Your Next Page…

Loading the guide and preparing its examples for you to explore. The page will appear here automatically when it’s ready, so you can keep this view open without refreshing.

Made for Preact. Built to be yours.

Overlays & Actions

Dropdown

Context menu from a trigger — dismiss layer, positioning, asChild trigger, submenus, shortcuts, checkbox and radio items (shadcn Dropdown Menu pattern). Reveal the right amount of context without losing the user's place in the interface. Keep the trigger, content and dismissal behavior working as one interaction. Import it from @/components/kamod-ui/dropdown.

Source · Design reference · API reference · Theming · Styles


Interactive Live Preview
Try it. Make it yours.

Installation

Import Dropdown primitives from @/components/kamod-ui/dropdown.

Install PackagesTerminal
pnpm add @kamod-ch/ui

Copy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.

Usage

Use DropdownTrigger to toggle, DropdownContent for the panel (side, align, sideOffset). Optional DropdownSub / DropdownSubTrigger / DropdownSubContent for nested menus; DropdownSubContent supports side="inline-end" (default) or side="inline-start" to open toward the inline end or start (use inline-start when the trigger is near the viewport edge to avoid horizontal page scroll). Checkbox and radio items do not use DropdownItem’s auto-close behavior where noted.

Import SetupTypeScript
import { Dropdown } from "@kamod-ch/ui";

Choose a complete composition from the examples below; required child components and props vary by pattern.

Component Examples & Variants

Explore Dropdown in Different Contexts, from the starting pattern to the compositions below. Begin with Basic, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.

Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.

Basic

Keep the Menu Focused on Related Commands. Pair the default dropdown trigger with a short menu of related operations. Each menu item should represent an action available from that trigger, giving the reader a predictable set of choices when the popup opens.

Essential actions should have a discoverable trigger, and navigation items should retain link semantics where appropriate; a menu's visual grouping does not replace the behavior of its individual entries.

src/components/DropdownExample.tsx11 lines
import { Dropdown, DropdownContent, DropdownItem, DropdownTrigger } from "@kamod-ch/ui";

export const Example = () => (
  <Dropdown>
    <DropdownTrigger>Open menu</DropdownTrigger>
    <DropdownContent>
      <DropdownItem>Profile</DropdownItem>
      <DropdownItem>Settings</DropdownItem>
    </DropdownContent>
  </Dropdown>
);

Trigger asChild

Make the Existing Control the Actual Trigger. Use asChild to make a Button or another compatible element the dropdown trigger. The child keeps its chosen presentation while receiving the behavior needed to open and control the associated menu.

Preserve a meaningful accessible name, forwarded attributes and focus styling, and choose a label that explains the menu rather than the visual symbol used to open it.

Interactive Live Preview
Try it. Make it yours.

Groups, Shortcuts, Icons

Add Structure Only Where It Helps Scanning. Organize a longer dropdown with labels, separators and recognizable icons, reserving trailing space for shortcut hints. These elements explain the hierarchy of the actions without changing the operation attached to each item.

Keep these cues secondary to the command text, and do not show a shortcut unless your application actually registers and maintains that behavior.

Interactive Live Preview
Try it. Make it yours.

Checkbox Items

Use Checkmarks for Independent Settings. Use checkbox menu items for independent settings that can be changed without closing the root menu. Their checked values should describe the same state used by the rest of the interface after the menu is dismissed.

Bind each checked value to the actual application state and make the effect of each label clear; a checked menu item should reflect a setting, not merely the last command clicked.

Interactive Live Preview
Try it. Make it yours.

Radio Group

Represent One Current Choice. Use DropdownRadioItem within a radio group for one choice among alternatives. Selecting an item updates the chosen value and closes the menu, so the trigger or surrounding interface should make the result visible.

Reopen the menu after changing the setting elsewhere in the application to verify that the marked option follows parent state. Use stable option values, keeping translated labels separate from the data used to apply the preference.

Interactive Live Preview
Try it. Make it yours.

Positioning

Position for the Available Space. Set side, align and sideOffset on DropdownContent to position the menu relative to its trigger. These choices tune the available space around the popup without changing the labels or behavior of its actions.

Test triggers near each edge and within scrolling containers. When a parent clips overflow, pass portal so the menu renders in document.body instead of being cut off. Avoid large offsets that make the menu feel disconnected from its source.

Interactive Live Preview
Try it. Make it yours.
API reference

Props and Data

Configure Dropdown using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.

Props, slots and variants for this component.

API reference
Your API, from source

Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.

Component Props

Read each option with its owning component. The
marker identifies required fields verified in that declaration. A ? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.
@kamod-ch/ui/dropdown44.8 KB min · 10.7 KB gzipSignals: direct@preact/signals

Dropdown

DropdownProps

Dropdown documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownProps

Configure children for Dropdown. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownProps

Configure class for Dropdown. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
defaultOpen
booleanDropdownProps

Configure defaultOpen for Dropdown. Compare its accepted type with the Usage Guidance before supplying a value.

Default
false

DropdownCheckboxItem

DropdownCheckboxItemProps

DropdownCheckboxItem documented props
Prop / typeDescription
checked
booleanDropdownCheckboxItemProps

Configure checked for DropdownCheckboxItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
children
ComponentChild[] | ComponentChildDropdownCheckboxItemProps

Configure children for DropdownCheckboxItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownCheckboxItemProps

Configure class for DropdownCheckboxItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
defaultChecked
booleanDropdownCheckboxItemProps

Configure defaultChecked for DropdownCheckboxItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
false
disabled
boolean | SignalLike<boolean | undefined>DropdownCheckboxItemProps

Configure disabled for DropdownCheckboxItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onCheckedChange
((checked: boolean) => void)DropdownCheckboxItemProps

Configure onCheckedChange for DropdownCheckboxItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onClick
MouseEventHandler<HTMLButtonElement>DropdownCheckboxItemProps

Configure onClick for DropdownCheckboxItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownContent

DropdownContentProps

DropdownContent documented props
Prop / typeDescription
align
"start" | "center" | "end"DropdownContentProps

Configure align for DropdownContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
"start"
children
ComponentChild[] | ComponentChildDropdownContentProps

Configure children for DropdownContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownContentProps

Configure class for DropdownContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
forceMount
booleanDropdownContentProps

Configure forceMount for DropdownContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
false
onKeyDown
KeyboardEventHandler<HTMLDivElement>DropdownContentProps

Configure onKeyDown for DropdownContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
portal
booleanDropdownContentProps

Render in `document.body`, align to the trigger, and keep the menu in the viewport. Default `false` (inline next to the trigger). Set `portal` when a parent uses `overflow: hidden` or scroll clipping would cut off the menu.

Default
false
side
"bottom" | "top" | "right" | "left"DropdownContentProps

Configure side for DropdownContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
"bottom"
sideOffset
numberDropdownContentProps

Configure sideOffset for DropdownContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
4
style
string | CSSProperties | SignalLike<string | CSSProperties | undefined>DropdownContentProps

Configure style for DropdownContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownGroup

DropdownGroupProps

DropdownGroup documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownGroupProps

Configure children for DropdownGroup. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownGroupProps

Configure class for DropdownGroup. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownItem

DropdownItemProps

DropdownItem documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownItemProps

Configure children for DropdownItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownItemProps

Configure class for DropdownItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
href
Signalish<string> & stringDropdownItemProps

Configure href for DropdownItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
inset
"true"DropdownItemProps

Configure inset for DropdownItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
false
onClick
MouseEventHandler<HTMLAnchorElement>DropdownItemProps

Configure onClick for DropdownItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
variant
"default" | "destructive"DropdownItemProps

Configure variant for DropdownItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
"default"

DropdownLabel

DropdownLabelProps

DropdownLabel documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownLabelProps

Configure children for DropdownLabel. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownLabelProps

Configure class for DropdownLabel. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
inset
booleanDropdownLabelProps

Configure inset for DropdownLabel. Compare its accepted type with the Usage Guidance before supplying a value.

Default
false

DropdownPortal

DropdownPortalProps

DropdownPortal documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownPortalProps

Configure children for DropdownPortal. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownRadioGroup

DropdownRadioGroupProps

DropdownRadioGroup documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownRadioGroupProps

Configure children for DropdownRadioGroup. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
defaultValue
stringDropdownRadioGroupProps

Configure defaultValue for DropdownRadioGroup. Compare its accepted type with the Usage Guidance before supplying a value.

Default
""
onValueChange
((value: string) => void)DropdownRadioGroupProps

Configure onValueChange for DropdownRadioGroup. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
value
stringDropdownRadioGroupProps

Configure value for DropdownRadioGroup. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownRadioItem

DropdownRadioItemProps

DropdownRadioItem documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownRadioItemProps

Configure children for DropdownRadioItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownRadioItemProps

Configure class for DropdownRadioItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
disabled
boolean | SignalLike<boolean | undefined>DropdownRadioItemProps

Configure disabled for DropdownRadioItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onClick
MouseEventHandler<HTMLButtonElement>DropdownRadioItemProps

Configure onClick for DropdownRadioItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
value
Signalish<string | number | undefined> & stringDropdownRadioItemProps

Configure value for DropdownRadioItem. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownSeparator

DropdownSeparatorProps

DropdownSeparator documented props
Prop / typeDescription
class
string | SignalLike<string | undefined>DropdownSeparatorProps

Configure class for DropdownSeparator. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownShortcut

DropdownShortcutProps

DropdownShortcut documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownShortcutProps

Configure children for DropdownShortcut. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownShortcutProps

Configure class for DropdownShortcut. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownSub

DropdownSubProps

DropdownSub documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownSubProps

Configure children for DropdownSub. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownSubProps

Configure class for DropdownSub. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

DropdownSubContent

DropdownSubContentProps

DropdownSubContent documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownSubContentProps

Configure children for DropdownSubContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownSubContentProps

Configure class for DropdownSubContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onKeyDown
KeyboardEventHandler<HTMLDivElement>DropdownSubContentProps

Configure onKeyDown for DropdownSubContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onPointerEnter
PointerEventHandler<HTMLDivElement>DropdownSubContentProps

Configure onPointerEnter for DropdownSubContent. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
side
SubmenuSideDropdownSubContentProps

`inline-end` (default): opens toward inline end (right in LTR). `inline-start`: toward inline start (left in LTR) — use near the viewport edge to avoid horizontal page scroll.

Default
"inline-end"

DropdownSubTrigger

DropdownSubTriggerProps

DropdownSubTrigger documented props
Prop / typeDescription
children
ComponentChild[] | ComponentChildDropdownSubTriggerProps

Configure children for DropdownSubTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownSubTriggerProps

Configure class for DropdownSubTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onClick
MouseEventHandler<HTMLButtonElement>DropdownSubTriggerProps

Configure onClick for DropdownSubTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onKeyDown
KeyboardEventHandler<HTMLButtonElement>DropdownSubTriggerProps

Configure onKeyDown for DropdownSubTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onPointerEnter
PointerEventHandler<HTMLButtonElement>DropdownSubTriggerProps

Configure onPointerEnter for DropdownSubTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
side
SubmenuSideDropdownSubTriggerProps

Must match `DropdownSubContent` `side` for arrow-key open direction.

Default
"inline-end"

DropdownTrigger

DropdownTriggerProps

DropdownTrigger documented props
Prop / typeDescription
asChild
booleanDropdownTriggerProps

Configure asChild for DropdownTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
false
children
ComponentChild[] | ComponentChildDropdownTriggerProps

Configure children for DropdownTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
class
string | SignalLike<string | undefined>DropdownTriggerProps

Configure class for DropdownTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onClick
MouseEventHandler<HTMLButtonElement>DropdownTriggerProps

Configure onClick for DropdownTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
onKeyDown
KeyboardEventHandler<HTMLButtonElement>DropdownTriggerProps

Configure onKeyDown for DropdownTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—
ref
Ref<HTMLButtonElement>DropdownTriggerProps

Configure ref for DropdownTrigger. Compare its accepted type with the Usage Guidance before supplying a value.

Default
—

Data Type Reference

Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.

DropdownContextValue

9 declared fields
DropdownContextValue
Exported Source Declaration from Dropdown.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownContextValue before adapting it.
Required fields
open, setOpen, triggerId, contentId, rootRef, triggerRef, contentRef, triggerClickHandledRef, clickIntentRef

Dropdown Props

2 declared fields
DropdownProps
Exported Source Declaration from Dropdown.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownProps before adapting it.

DropdownCheckboxItem Props

4 declared fields
DropdownCheckboxItemProps
Exported Source Declaration from DropdownCheckboxItem.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownCheckboxItemProps before adapting it.

DropdownContent Props

6 declared fields
DropdownContentProps
Exported Source Declaration from DropdownContent.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownContentProps before adapting it.

DropdownGroup Props

1 declared field
DropdownGroupProps
Exported Source Declaration from DropdownGroup.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownGroupProps before adapting it.

DropdownItemShared Props

1 declared field
DropdownItemSharedProps
Local Source Declaration from DropdownItem.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownItemSharedProps before adapting it.

DropdownItem Props

Declaration
DropdownItemProps
Exported Source Declaration from DropdownItem.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownItemProps before adapting it.

DropdownLabel Props

2 declared fields
DropdownLabelProps
Exported Source Declaration from DropdownLabel.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownLabelProps before adapting it.

DropdownPortal Props

1 declared field
DropdownPortalProps
No-op wrapper for API parity with shadcn; content stays in the tree (no portal). Inspect the Complete Definition of DropdownPortalProps before adapting it.

DropdownRadioGroup Props

4 declared fields
DropdownRadioGroupProps
Exported Source Declaration from DropdownRadioGroup.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownRadioGroupProps before adapting it.

DropdownRadioItem Props

2 declared fields
DropdownRadioItemProps
Exported Source Declaration from DropdownRadioItem.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownRadioItemProps before adapting it.
Required fields
value
DropdownSeparatorProps
Exported Source Declaration from DropdownSeparator.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownSeparatorProps before adapting it.

DropdownShortcut Props

1 declared field
DropdownShortcutProps
Exported Source Declaration from DropdownShortcut.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownShortcutProps before adapting it.

DropdownSub Props

1 declared field
DropdownSubProps
Exported Source Declaration from DropdownSub.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownSubProps before adapting it.

DropdownSubContent Props

2 declared fields
DropdownSubContentProps
Exported Source Declaration from DropdownSubContent.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownSubContentProps before adapting it.

DropdownSubTrigger Props

2 declared fields
DropdownSubTriggerProps
Exported Source Declaration from DropdownSubTrigger.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownSubTriggerProps before adapting it.

DropdownTrigger Props

2 declared fields
DropdownTriggerProps
Exported Source Declaration from DropdownTrigger.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownTriggerProps before adapting it.

DropdownRadioContextValue

2 declared fields
DropdownRadioContextValue
Exported Source Declaration from dropdown-radio-context.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownRadioContextValue before adapting it.
Required fields
value, setValue

DropdownSubContextValue

4 declared fields
DropdownSubContextValue
Exported Source Declaration from dropdown-sub-context.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of DropdownSubContextValue before adapting it.
Required fields
open, setOpen, markFocusOnOpen, consumeFocusOnOpen

Accessibility

Build the Complete Interaction, Including the Parts Outside Dropdown. The notes below distinguish the current implementation from the labels, content and behavior your application supplies. Start with the Live Preview, check the Props and Data Reference, and test the finished composition with real content rather than assuming that an unchanged visual example covers every use case.

Built-in Behavior and Defaults

DropdownTrigger exposes aria-haspopup="menu", expanded state and the controlled content ID. Content and items use menu roles, including checked states for checkbox and radio items. Escape closes the menu and returns to its trigger.

Labels and Relationships

Name the trigger by its action scope, such as Invoice actions, and use specific item text. Keep shortcuts supplementary: the item name must describe the action even when the keyboard hint is omitted.

Keyboard and Focus

Exercise the shipped menu keyboard behavior with enabled, disabled and nested items. Reuse its item components and focus handling rather than installing a second document-level listener. Verify the complete path through a submenu and back to its parent.

States and Integration Details

Menu roles promise more than a visually positioned list. Test arrow-key behavior and screen-reader output in the exact composition rather than assuming parity with another library. For ordinary site destinations, consider navigation links instead of application-menu semantics.

Verify the Complete Interaction

Check Behavior as Well as Markup. Work through these scenarios in the application where the component will be used. Automated checks can help find structural problems; also review the reading experience with a screen reader, keyboard focus and the actual feedback from your application.

  1. Open, choose an action and dismiss without a pointer; confirm return focus.
  2. Check selected/checked menu items and disabled actions with assistive technology.
  3. Traverse nested menus and long localized labels without losing focus or triggering the wrong action.

Recheck the result after changing Theme Tokens, translations or class overrides. Include text enlargement, narrow layouts and reduced-motion settings where animation is present. Inspect the Component Source when a behavior differs from your expectation; a role or state attribute does not implement keyboard interaction by itself.

For background, read the WAI-ARIA Authoring Guidance and Keyboard Interface Guidance. These explain the patterns; verify browser and assistive-technology behavior for the implementation and audience you actually support.

Take the Next Useful Step

You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.

Connect the Foundation

Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.

Build the Surrounding Screen

Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.

Make the Result Hold Up

Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.

Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.