Page History
...
- visibilityPolicySetId – Determines the visibility of the component based on user permissions and policy sets. For example, setting to
"adminOnlyPolicy"restricts the overflow menu to users with admin privileges.
Guidelines
Common Use Cases
- Row actions in tables – Providing actions like Edit, Delete, Archive for individual table rows
- Page-level actions – Housing secondary actions that don't warrant primary button placement
- Settings menus – Offering configuration options in a compact dropdown
- Export options – Providing various export formats like PDF, Excel, CSV
Design Considerations
- Use consistent iconography that clearly communicates the menu's purpose
- Order menu items by frequency of use or logical grouping
- Consider adding dividers between logical groups of options
- Keep the number of options reasonable (generally fewer than 7–8 items)
- Use clear, concise labels for each option
- Add icons to options when they help with quick visual recognition
- This component helps maintain a clean, uncluttered interface while still providing access to important functionality when needed.
Usage
- Use the menu button icon to match intent. Set
iconNameto a generic “More” icon, or a generic "Settings" icon for configuration menus to set user expectation. - Keep the list focused (≤ 7–8 items) to reduce decision time. Order by frequency or logical groups.
- Provide clear labels with
options[n].text. Use short, action-first verbs (e.g., “Edit”, “Archive”). - Add recognizable affordances where helpful: set
options[n].showMenuLinkIconplusiconPositionKeyand eithermenuLinkLeftIconNameormenuLinkRightIconName. Prefer left-placed icons for faster scanning. - Name the instance meaningfully in authoring tools so teams can find it later: set
displayName(e.g.,"Row actions").
Sizing & Layout
- Control where the dropdown opens with
placement: use"bottom"when the button is near the top edge; use"top"near the bottom; use"left"/"right"to avoid clipping against side gutters. - Adjust hit-target and breathing room with
paddingClass. For touch or glove scenarios, increase padding (e.g.,"p-3"instead of"p-2").
States & Feedback
- Initialize data or compute context on load using
events.ON_INIT(e.g., pre-buildoptions, setdisplayConditionsflags). - Clean up listeners or ephemeral state with
events.ON_DESTROY. - Wire behavior per item with
events.ON_OPTION_CLICK. Attach distinct handlers peroptions[n]to trigger navigation, mutations, or analytics.
Color & Contrast
- Don’t rely on color alone. Use
options[n].showMenuLinkIconwith an appropriate…IconNameto reinforce meaning. Choose icon names with distinct silhouettes viaiconName/menuLink…IconName.
Interactions & Events
- For each menu item, bind a unique action via
events.ON_OPTION_CLICKso telemetry and logic reflect the selected option. - For onboarding, make the button discoverable by enabling its tour hotspot: set
enableAsHotspot: truewithguidedTourHotSpotTitleandguidedTourHotSpotDescriptionfor the callout copy.
Data-Driven Behavior / Thresholds
- Show or hide the menu based on context with
displayConditions(e.g., show only when a row is selected). - Use
events.ON_INITto compute whether to include optionaloptions(e.g., add “Undo” only when last action exists).
Visibility & Authorization
- Enforce permissions with
visibilityPolicySetIdso only authorized users see the menu (e.g.,"adminOnlyPolicy"). - Combine with
displayConditionsto suppress the control in invalid contexts (e.g., non-editable states).
Content & Localization
- Keep
options[n].textconcise (2–3 words) and concrete (“Delete record”, not “Do operation”). - If you highlight the menu in guided tours, localize the hotspot copy using
guidedTourHotSpotTitleandguidedTourHotSpotDescription(both support translations).
Environment & Input Methods
- In industrial/touch contexts, prefer larger tap targets: increase
paddingClass(e.g.,"p-3"), and place icons left viaiconPositionKey: "menuLinkLeftIconName"to support quick visual anchoring. - When space is tight near edges, set
placementto avoid off-screen rendering.
Testing Hooks
- Add stable selectors for automation with
idanddataTestId(e.g.,dataTestId: "row-ovrflow").
Do & Don’t
| Do | Don’t | Relevant settings |
|---|---|---|
Use a purposeful button icon (e.g., iconName: "more-outline" for overflow, "settings-outline" for configuration). | Reuse a generic icon that misleads users about what’s inside. | iconName |
| Keep the menu focused (≤ 7–8 items) and order by frequency. | Dump every action into one long list. | options (length & order) |
| Add helpful item icons to speed recognition (left-aligned). | Rely on color alone to convey meaning. | options[n].showMenuLinkIcon, iconPositionKey, menuLinkLeftIconName |
Choose placement to avoid clipping near screen edges. | Leave default placement that causes off-screen or covered items. | placement |
| Gate visibility by role or context so only valid users see it. | Show the menu to everyone and fail on click. | visibilityPolicySetId, displayConditions |
| Bind distinct handlers per option for clear analytics and behavior. | Handle all clicks with one catch-all that ignores which item was pressed. | events.ON_OPTION_CLICK |
| Precompute dynamic options on init; clean up on destroy. | Build options ad-hoc on first click; leak listeners. | events.ON_INIT, events.ON_DESTROY, options |
| Make it discoverable in tours with clear copy. | Enable hotspot without title/description. | enableAsHotspot, guidedTourHotSpotTitle, guidedTourHotSpotDescription |
| Increase padding for touch/gloves. | Keep small targets that are hard to tap. | paddingClass |
| Use stable hooks for tests. | Target DOM structure or visible text that may change. | id, dataTestId |
Accessibility
Usage
- Use the component to reveal contextual or secondary actions by configuring the trigger icon with
iconNameand the list of items withoptions. - Place the dropdown where it will not obscure the trigger or key content by setting
placementto"bottom","top","right", or"left"according to available space. - Keep actions concise and scannable by writing clear labels in
options[].textand, when recognition helps, enablingoptions[].showMenuLinkIconto pair labels with icons. - Keep menus lightweight by constraining the length of the
optionsarray to a manageable number (for example, around eight) so choices remain easy to scan. - Use side-specific icons consistently by setting
options[].iconPositionKeyto"menuLinkLeftIconName"or"menuLinkRightIconName", and assigningoptions[].menuLinkLeftIconNameoroptions[].menuLinkRightIconNameaccordingly.
Sizing & Layout
- Adjust the trigger’s tap/click comfort and breathing room using
paddingClass(for example,"p-1","p-2","p-3") to align visually with nearby controls. - Keep item alignment steady by choosing a single
options[].iconPositionKeyvalue so labels inoptions[].textline up across the list. - Prevent clipping and reduce pointer travel by choosing an appropriate
placementrelative to the trigger using the"top","right","bottom", or"left"values.
States & Feedback
- Run setup logic at creation with
ON_INIT(declared inevents) when the menu should register analytics or prepare context foroptions. - Perform cleanup on teardown with
ON_DESTROY(declared inevents) when initialization attached resources that need removal. - Provide immediate feedback on selection by wiring per-item handlers in
options[].eventssoON_OPTION_CLICKtriggers the intended action flow.
Interactions & Events
- Navigate or execute tasks by attaching actions to
options[].eventsfor theON_OPTION_CLICKtype; ensure the intent is reflected by clearoptions[].text. - Gate destructive actions behind confirmation by routing
ON_OPTION_CLICKinoptions[].eventsthrough a confirmation step before execution. - Enable onboarding assistance by turning on
enableAsHotspotand providingguidedTourHotSpotTitleandguidedTourHotSpotDescriptionso the trigger can be highlighted in a guided tour.
Data-Driven / Conditional Behavior
- Show only relevant actions for the current context by passing a context-appropriate
optionsarray to the component. - Convey action semantics with icons by enabling
options[].showMenuLinkIconand settingoptions[].menuLinkLeftIconNameoroptions[].menuLinkRightIconNameconsistently withoptions[].iconPositionKey.
Visibility & Authorization
- Show or hide the trigger based on context by defining
displayConditionsthat resolve to true only when actions are applicable. - Restrict access by setting
visibilityPolicySetIdso the overflow menu appears only for users in the permitted policy set.
Dos & Don’ts
| Do | Don’t | Article setting(s) |
|---|---|---|
Use placement="bottom" when the trigger is near the top edge so the menu opens into available space. | Use placement="top" in the same case, causing the menu to clip against the top edge. | placement |
Keep labels short and action-oriented by writing options[].text like “Edit item.” | Use vague options[].text such as “Done,” which obscures intent. | options[].text |
Pair icons with labels by enabling options[].showMenuLinkIcon and setting options[].menuLinkLeftIconName. | Rely on icons without options[].text, reducing clarity. | options[].showMenuLinkIcon, options[].menuLinkLeftIconName |
Confirm risky actions by routing ON_OPTION_CLICK through a confirmation step in options[].events. | Execute destructive actions immediately on ON_OPTION_CLICK without confirmation. | options[].events, ON_OPTION_CLICK |
Keep the menu scannable by limiting the options array to a manageable size. | Overload options with long lists that slow scanning and selection. | options |
Use paddingClass to ensure the trigger has a comfortable hit area next to other controls. | Leave paddingClass unset so the trigger feels cramped or hard to tap. | paddingClass |
Place item icons consistently with options[].iconPositionKey="menuLinkLeftIconName" across all entries. | Mix left and right icon positions arbitrarily, causing alignment jitter. | options[].iconPositionKey |
Accessibility
Protocol of implemented accessibility measures
- Provide explicit, readable action labels with
options[].textso assistive technologies can announce them clearly. - Avoid meaning by color or icon alone by pairing
options[].showMenuLinkIconwith text labels inoptions[].text. - Reduce occlusion and surprise by selecting a predictable
placementso the dropdown appears where users expect. - Support automated checks and stable selectors by setting
dataTestIdandid. - Improve onboarding comprehension by enabling
enableAsHotspotand supplying descriptiveguidedTourHotSpotTitleandguidedTourHotSpotDescriptionstrings.
Practices to improve accessibility
- Prefer short, verb-led phrases in
options[].textand avoid jargon to aid screen readers and translation. - Keep icon placement consistent using
options[].iconPositionKeyso the reading order remains stable. - Confirm destructive actions via
options[].eventsusingON_OPTION_CLICKto present a confirmation step before the action proceeds. - Ensure consistent placement across similar menus by standardizing
placementwithin a product area. - Populate
dataTestIdto integrate automated accessibility tests and regressions in pipelines - Provide textual labels for every option via
options[n].text; avoid icon-only entries so screen reader and low-vision users have clear labels. - Don’t rely on color alone to convey meaning—pair color with an icon by setting
options[n].showMenuLinkIcon,iconPositionKey, andmenuLinkLeftIconName/menuLinkRightIconName. - Increase the hit area for users with motor constraints (e.g., gloves) by using a larger
paddingClassvalue such as"p-3". - Keep the menu fully visible at high zoom or limited visual fields by choosing an appropriate
placement("top" | "right" | "bottom" | "left") to avoid off-screen clipping. - Limit cognitive load: keep
optionsfocused (generally ≤ 7–8 items) and order by frequency so choices are easy to scan and decide. - For guided onboarding, enable the hotspot and provide concise, descriptive copy with
enableAsHotspot,guidedTourHotSpotTitle, andguidedTourHotSpotDescription; include translated text where applicable.