Skip to content

Dropdown โ€‹

A flexible floating overlay that pairs any activator (slot="main") with any body content (slot="body"). Twelve placements (top/bottom/left/right ร— bare, -start, -end), three trigger modes (click / hover / manual), six theme colours, sm/md/lg sizes. The panel auto-flips to the opposite side when the requested side runs out of viewport space and shifts along the cross-axis to stay on-screen. Outside-click and Escape both close (configurable). Toggle Vue / CSS to switch the live demo and source together.

Basic โ€‹

Click an activator button to open a dropdown panel below it.

Vue SFC

Placements โ€‹

All 12 placements: top/bottom/left/right combined with -start, -end and bare (centered).

Vue SFC

Auto-flip + shift โ€‹

Triggers placed near each viewport edge โ€” the panel flips to the side with more room and shifts inward to stay on-screen.

Vue SFC

Sizes โ€‹

Small, medium and large.

Vue SFC

Colors โ€‹

All built-in color variants.

Vue SFC

Triggers โ€‹

Click vs hover modes side-by-side.

Vue SFC

With mono-button โ€‹

Use a real <mono-button> as the activator inside slot="main".

Vue SFC

Rich content โ€‹

The body slot can host any HTML โ€” including other mono components like input, checkbox, and button.

Vue SFC

Disabled โ€‹

The activator does nothing on click.

Vue SFC

Event log โ€‹

Live log of mno-click / mno-open / mno-close with the source field and resolvedSide.

Vue SFC

Customized โ€‹

Override per-element styling with cssClass (Vue) or utility classes (CSS).

Vue SFC

CSS Variables โ€‹

Vue SFC

Every dropdown is themed through --mono-dropdown-* custom properties. Setting one on the element, on any wrapper/ancestor, or inline all work โ€” custom properties inherit, and they pierce the shadow-DOM boundary, so the same overrides apply to <mono-dropdown> and the shadow build. The size and color props set presets, but an explicit --mono-dropdown-* override always wins. To re-skin globally, set the underlying --theme-* tokens.

VariableDefaultControls
--mono-dropdown-accent--theme-primaryPanel border tint + glow shadow (set by color)
--mono-dropdown-text--theme-textPanel text color
--mono-dropdown-bg--theme-surfacePanel background
--mono-dropdown-border--theme-borderPanel base border color
--mono-dropdown-radius9pxPanel corner radius (set by size)
--mono-dropdown-pad-x0.75remPanel horizontal padding (set by size)
--mono-dropdown-pad-y0.6remPanel vertical padding (set by size)
--mono-dropdown-font0.74remPanel font size (set by size)
--mono-dropdown-min-width200pxPanel min width (set by size)
--mono-dropdown-max-width280pxPanel max width (set by size)
--mono-dropdown-offset6pxGap between activator and panel (set by size)

Types โ€‹

Importimport { DropdownProps } from 'mono-helper'
PropValueDefaultDescription
modelValuebooleanโ€”Two-way bound open state of the dropdown.
placement'left' | 'right' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'โ€”Panel placement relative to the trigger.
trigger'click' | 'hover' | 'manual'โ€”How the dropdown opens: click, hover, or manual.
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'โ€”Sizing scale of the dropdown panel.
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info'โ€”Color theme applied to the dropdown.
disabledbooleanโ€”Disables interaction and prevents opening.
flipbooleanโ€”When true, the panel auto-flips to the opposite side when the preferred side does not have enough room in the viewport.
shiftbooleanโ€”When true, the panel shifts along the cross axis to stay inside the viewport instead of overflowing.
offsetnumberโ€”Pixel gap between the activator and the panel.
closeOnOutsideClickbooleanโ€”Closes the dropdown when clicking outside it.
closeOnEscapebooleanโ€”Closes the dropdown when the Escape key is pressed.
cssClassDropdownCssClassโ€”Per-element class overrides for internal parts.