Components

Dropdown Menu ​

Dropdown menus reveal secondary actions, settings, and grouped choices without permanently occupying layout space.

Basic Usage ​

Use a simple trigger and a short action list for the most common menu pattern.

Grouped Options ​

Labels, separators, check items, radio items, and shortcuts help organize denser menu content without losing scanability.

Different Triggers ​

Menus often sit behind different trigger styles depending on whether the action is primary, contextual, or account-related.

Submenus are useful for deeper action trees, but they should stay narrow and clearly grouped.

Selection Items ​

Use checkbox and radio items for menu options that change persistent view or sorting state.

Item Icons ​

Leading icons go in the item’s prefix slot (or start).

Sizes ​

size on DropdownMenu scales items, labels, and icons together.

Slotted labels and host metrics ​

Item labels live in light DOM (default slot). They inherit type metrics from the DropdownItem :host — not from the shadow .item row, and not from the menu host or page. Size tokens set --pk-dropdown-item-font-size / --pk-dropdown-item-line-height on the item host so Craft CP (tight body line-height) and Tailwind-scoped hosts get the same row rhythm without consumer CSS.

Do not put font-size / line-height on DropdownMenu (or a wrapper) expecting item labels to pick them up for layout — ancestor noise can crush rows until the kit :host pin is present. After that pin, consumers should remove temporary menu-host type overrides.

Stress this in the workshop playground at /tools/slotted-host: Craft vs Tailwind hosts, ellipsis + icon menus, a text-trigger type picker, an ancestor line-height: normal case, selects, overlay mode, and Measure popups.

API ​

Slots ​

NameDescription
triggerMenu trigger (when not using for)
(default)pk-dropdown-item elements

Props ​

NameDescription
distanceType number
Default 4
forExternal trigger id — preferred over slot="trigger" when set (TipTap toolbar).
Type string
openType boolean
Default false
placementType PkPopupPlacement
Default bottom-start
sideOffsetType number
Default 4
sizeType PkDropdownMenuSize
Default default
skiddingType number
Default 0

Events ​

NameDescription
onPkOpenChange—

CSS Parts ​

NameDescriptionCSS selector
panelMenu panel::part(panel)

Dependencies ​

This component registers the following elements when it loads.

NameDescription
pk-popup—

Slots ​

NameDescription
(default)Item label
startLeading icon (preferred; matches pk-button)
prefixAlias for start (legacy)
detailsTrailing shortcut text
submenuNested menu items (pk-dropdown-item, separators, labels)

Props ​

NameDescription
activeRoving highlight index for keyboard nav (active). Visual styling uses :focus-visible / hover — not this flag — so mouse-open does not paint the first item selected (initial open).
Type boolean
Default false
checkedType boolean
Default false
destructiveType boolean
Default false
disabledType boolean
Default false
radioGroupType string
submenuOpenType boolean
Default false
typeType PkDropdownItemType
Default normal
valueType string

Methods ​

NameDescription
focusControl()—

Events ​

NameDescription
onPkSubmenuOpen—

CSS Parts ​

NameDescriptionCSS selector
checkCheckbox/radio selected indicator::part(check)
itemMenu item button::part(item)
labelItem label wrapper::part(label)
prefixLeading icon wrapper (hidden when empty)::part(prefix)

No public API metadata found in the custom elements manifest.

No public API metadata found in the custom elements manifest.

Edit this page
Last updated: Sep 15, 2026, 1:09 PM