Lapikit

Dropdown component

Dropdown

The Dropdown component displays a menu or contextual content when opened, positioned around a trigger element. It can be opened by clicking or hovering, and closes automatically according to selected parameters (closeOnClick, openOnHover, etc.).

It’s designed to offer great flexibility: configurable positioning, customizable appearance, and a customizable activator for total trigger control.

Examples of dropdown

Base

A simple example of a click-triggered dropdown, with default content displayed below the trigger.

Ref

Demonstrate how to use the ref prop to directly manipulate or target the dropdown DOM element.

Position

Allows you to dynamically position the menu in relation to its trigger (top, center, bottom). Useful for managing space constraints in the UI.

Close on click

The menu closes automatically when an item inside is clicked. Handy for action lists or quick links.

Open on hover

The dropdown opens automatically when the trigger is hovered over, without the need to click. Ideal for secondary menus or navigation bars.

API Reference

propstypedescriptiondefaulttype_extend
ref $bindableHTMLElementDirect access to DOM elementundefined
darkbooleanEnable dark theme for component.false
lightbooleanEnable light theme for the component.false
colorstringApplies a custom color to text or icons.undefined
backgroundstringApply a custom background color.undefined
persistentbooleanPrevent closing by clicking outside or with Escape.false
positionenumVertical position of content on screencenterbottom | center | top
openOnHoverbooleanAutomatically opens the menu when the trigger is hovered overfalse
closeOnClickbooleanCloses the menu when an item is clickedfalse
activatorSnippetAllows you to dynamically customize the dropdown trigger. Receives component props, open or close state, and a DOM element or event as context.undefined(ModelDropDownProps, state: open | close, element: HTMLElement | PointerEvent | null) => void

ModelDropdownProps

The ModelDropdownProps interface groups the properties automatically passed to the activator. It provides a clean way of typifying a dropdown’s custom trigger, giving access to the opening state and other useful options for dynamically adapting the trigger’s appearance or behavior.

Variables CSS

variabledefaultdescription
–-dropdown-color–-kit-on-surfaceText color
–-dropdown-background–-kit-surfaceBackground color
–-dropdown-radius--kit-radius-mdDropdown edge radius

Combine Dropdown with an Appbar or Popover for improved navigation ergonomics.

©2025 Lapikit.

Made with by Nycolaide