You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActionListItem is a primitive collection of components that renders elements as action item(s) within an ActionList or ActionListGroup. It is intended to be a replacement for the existing OptionsMenuItem component with some additional options.
This is an implementation of an aria menu pattern implementing the various roles and states necessary for menu items with selection(s).
Props
typeActionListItemBaseProps={/** * A unique key to identify the action when triggered, when not provided * will use the child text content as the key. */key?: string/** Provides an additional description for the list item. */description?: ContentNode/** Indicates if the current action list item is selected. */selected?: ContentNode/** When an action list item is disabled, it cannot be selected or activated. */disabled?: boolean/** A callback function that is called when an action list item is selected. */onAction: (event: React.MouseEvent<HTMLLIElement>|React.KeyboardEvent<HTMLLIElement>)=>void}typeActionListItemProps=ActionListItemBaseProps&React.HTMLAttributes<HTMLLIElement>typeActionListLinkItemProps={/** URL to link to for this action list item */href: string}&Omit<ActionListItemBaseProps,'selected'>&React.AnchorHTMLAttributes<HTMLAnchorElement>typeActionListSeparatorProps=React.HTMLAttributes<HTMLLIElement>
Implementations
The below components are intended to be direct children of an ActionList or ActionListGroup component.
ActionListItem
The role of the action list item is dependent on how it it rendered within an ActionList or ActionListGroup component:
If the selection type of the closest ActionList or ActionListGroup is not set, use role="menuitem"
If the selection type of the closest ActionList or ActionListGroup is set to single, use role="menuitemradio"
If the selection type of the closest ActionList of ActionListGroup is set to multiple, use role="menuitemcheckbox"
Each action list item should always have an id set for aria associations, either via props or using react-id-generator:
When disabled is set to true, aria-disabled should be set to true and any click or keypress events for the disabled item should be prevented.
When selected is set to true, aria-checked should be set if the role of the item is menuitemradio or menuitemcheckbox.
The description property should be displayed immediately below any children content of the ActionListItem. This can utilize a flex layout.
ActionListLinkItem
This component is an extension of the ActionListItem component but with an anchor child. The onAction event should be captured as an event on the child and not the li element.
ActionListSeparator
This is a display component with a role of separator. This component should only accept HTMLLiElement properties and a ref with no children.
The text was updated successfully, but these errors were encountered:
ActionListItem is a primitive collection of components that renders elements as action item(s) within an ActionList or ActionListGroup. It is intended to be a replacement for the existing OptionsMenuItem component with some additional options.
Related:
This is an implementation of an aria menu pattern implementing the various roles and states necessary for menu items with selection(s).
Props
Implementations
The below components are intended to be direct children of an
ActionList
orActionListGroup
component.ActionListItem
The role of the action list item is dependent on how it it rendered within an
ActionList
orActionListGroup
component:ActionList
orActionListGroup
is not set, userole="menuitem"
ActionList
orActionListGroup
is set tosingle
, userole="menuitemradio"
ActionList
ofActionListGroup
is set tomultiple
, userole="menuitemcheckbox"
Each action list item should always have an id set for aria associations, either via props or using
react-id-generator
:When
disabled
is set to true,aria-disabled
should be set totrue
and any click or keypress events for the disabled item should be prevented.When
selected
is set to true,aria-checked
should be set if the role of the item ismenuitemradio
ormenuitemcheckbox
.The
description
property should be displayed immediately below any children content of theActionListItem
. This can utilize a flex layout.ActionListLinkItem
This component is an extension of the
ActionListItem
component but with an anchor child. TheonAction
event should be captured as an event on the child and not theli
element.ActionListSeparator
This is a display component with a
role
ofseparator
. This component should only acceptHTMLLiElement
properties and a ref with no children.The text was updated successfully, but these errors were encountered: