Dark Light
System
Default LBBW Jira Confluence Source Code
Share
Playground

Dropdown Item

<afp-dropdown-item> Since 1.0.0 stable This component uses the light DOM, so its markup and styles are part of the regular document flow.

A dropdown item component to be used within an AfpDropdown.

Dropdown Item

Examples #

Details #

Use the details slot to add additional information to the dropdown item.

Details Item Ctrl Details Item 23 Details Item Lorem ipsum

Value #

The value attribute can be used to identify the dropdown item when it is clicked.

Toggle checked

Checked #

Use the checked attribute to indicate the checked state of the dropdown item.

Checked Item

Active #

Use the active attribute to indicate the active state of the dropdown item.

Active Item

Disabled #

Use the disabled attribute to disable the dropdown item.

Disabled Item

Custom Icons #

Use the check-icon slot to add a custom icon when the dropdown item is checked.

Details Item Ctrl

Custom Height #

Use the --afp-dropdown-item-height CSS variable to set a custom height for the dropdown item.

Custom Height

Properties

Learn more about properties.

Name Description Reflects
value
The value associated with the dropdown item. This is emitted with the afp-click event.
Type string
checked
Indicates whether the dropdown item is checked.
Type boolean
Default false
active
Indicates whether the dropdown item is active (highlighted).
Type boolean
Default false
disabled
Indicates whether the dropdown item is disabled.
Type boolean
Default false

Methods

Learn more about using methods.

Name Description Arguments
focus
Sets focus on the dropdown item.
options<FocusOptions> — Optional focus options.
activate
Activates the dropdown item, triggering the click handler.
-

Events

Learn more about events.

Name Return Description
afp-click string
Emitted when the dropdown item is clicked.

Slots

Learn more about slots.

Name Description
default
The default slot.
details
Slot for additional details or description.
check-icon
Slot to replace the default check icon.

CSS Parts

Learn more about CSS Parts.

Name Description Selector
base
The component's base wrapper.
::part(base)
content
The content wrapper.
::part(content)
checked
The checked icon wrapper.
::part(checked)
check-icon
The check icon.
::part(check-icon)
label
The label wrapper.
::part(label)
details
The details wrapper.
::part(details)

CSS Custom Properties

Name Description Default
--afp-dropdown-item-height
The height of the dropdown item.
--afp-size-xs
--afp-dropdown-item-checked-min-width
The minimum width of the checked icon area.
1.125rem
--afp-dropdown-item-disabled-opacity
The opacity of a disabled dropdown item.
0.5

Dependencies

The component automatically brings in the listed items, including any nested dependencies that may exist.

afp-icon

Importing

Using the bundle is the recommended method to include components. If you’d rather handle imports manually, you can use the code examples below.

import '@afp-design-system/core/dist/components/dropdown-item/dropdown-item.js';
Share
Create a link with a predefined theme that is automatically applied when the generated link is opened. Default LBBW Presentation Mode
Abort Copy Link