DropdownItem

OverviewExamplesPropertiesSlotsMethodsCSS PropertiesUsageIntegration

Dropdown item populates dropdown with actions. Items can be placed either inside a dropdown group or directly inside a dropdown component.

Loading...

Properties

PropertyAttribute Description TypeDefault
hrefhrefThe url the dropdown item should link to.string | undefined
targettargetWhen provided together with a href property, determines where to open the linked URL. The keywords have special meanings for where to load the URL: “_self” means the current browsing context, “_blank” usually a new tab but users can configure browsers this to open a new window instead, “_parent” means the parent browsing context of the current one, but if no parent exists, behaves as _self, and finally “top” means the topmost browsing context.'_self' | '_blank' | '_parent' | '_top''_self'
disableddisabledMakes the component disabled. This prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.booleanfalse

Slots

Slot name Description
Default slotThe dropdown item content.
startUsed to place content before dropdown item text. Typically used for icons.
endUsed to place content after dropdown item text. Typically used for icons.

Methods

Method nameParameters Description
focus(options?: FocusOptions) => voidoptions: An object which controls aspects of the focusing process.Programmatically move focus to the component.
blur() => voidN/AProgrammatically remove focus from the component.
click() => voidN/AProgrammatically simulates a click on the component.

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-dropdown-item-background-colorControls the background color of the item, using our color tokens.transparent
--n-dropdown-item-colorControls the color of the text within the item, using our color tokens.var(--n-color-text)

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Group dropdown items into dropdown groups based on related categories.
  • Use group headings to clarify the category of a section.

Don’t

  • Don’t use dropdown item outside of dropdown group and dropdown components.

Content guidelines

Dropdown items should be always written in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):

Create user
Create User

Dropdown items should always lead with a strong verb that encourages action. Use the {verb}+{noun} format except in the case of common actions like Save, Close or Cancel:

Edit row
Editing options

Avoid unnecessary words and articles in dropdown items, such as “the”, “an” or “a”:

Change theme
Change the theme

Avoid ending dropdown items in punctuation:

Switch user
Switch user.

Avoid all caps for dropdown items:

Rename
RENAME

Keep dropdown items to a single line of text:

Change theme
Change the theme
of the veterinary application.

Integration

For integration guidelines, please see Web Components documentation .

Was this page helpful?

Yes No

We use this feedback to improve our documentation.