<cs-dropdown-item>
StableActionsSince 0.1

Dropdown items represent selectable entries within a dropdown menu, including standard actions, checkable items, and submenu triggers.

This component must be used as a child of <cs-dropdown>. Please see the Dropdown docs to see examples of this component in action.

Copy⌘C Cut⌘X Delete

API

Importing

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick this component, use one of the following snippets.

npm Self-Hosted React
import '@cruglobal/cornerstone-components/components/dropdown-item/dropdown-item.js';
import './cornerstone/components/dropdown-item/dropdown-item.js';
import CsDropdownItem from '@cruglobal/cornerstone-components/react/dropdown-item/index.js';

Slots

Learn more about using slots.

NameDescription
(default)The dropdown item's label.
detailsAdditional content or details to display after the label.
iconAn optional icon to display before the label.
submenuSubmenu items, typically <cs-dropdown-item> elements, to create a nested menu.

Attributes & Properties

Learn more about attributes and properties.

PropertyAttributeDescriptionTypeDefaultReflects
checkedcheckedSet to true to check the dropdown item. Only valid when type is checkbox.booleanfalse
disableddisabledDisables the dropdown item.booleanfalseYes
submenuOpensubmenuOpenWhether the submenu is currently open.booleanfalseYes
typetypeSet to checkbox to make the item a checkbox.'normal' | 'checkbox''normal'Yes
valuevalueAn optional value for the menu item. This is useful for determining which item was selected when listening to the dropdown's cs-select event.string
variantvariantThe type of menu item to render.'danger' | 'neutral''neutral'Yes

Methods

Learn more about methods.

NameDescriptionArguments
closeSubmenu()Closes the submenu.
openSubmenu()Opens the submenu.

Events

Learn more about events.

NameDescription
blurEmitted when the dropdown item loses focus.
focusEmitted when the dropdown item gains focus.

CSS Parts

Learn more about CSS parts.

NameDescriptionCSS selector
checkmarkThe checkmark icon (a <cs-icon> element) when the item is a checkbox.::part(checkmark)
checkmark__svgThe checkmark icon's svg part.::part(checkmark__svg)
detailsThe container for the details slot.::part(details)
iconThe container for the icon slot.::part(icon)
labelThe container for the label slot.::part(label)
submenuThe submenu container.::part(submenu)
submenu-iconThe submenu indicator icon (a <cs-icon> element).::part(submenu-icon)
submenu-icon__svgThe submenu icon's svg part.::part(submenu-icon__svg)

Dependencies

This component automatically imports the following elements. Sub-dependencies, if any exist, are included in this list.