Dropdown

readyNot reviewed for a11y
This page may be removed. Primer plans to move all Rails component documentation to Lookbook.

Description

Dropdown is a lightweight context menu for housing navigation and actions. They're great for instances where you don't need the full power (and code) of the SelectMenu.

Arguments

NameRequiredDescription
overlay
Symbol

One of :dark, :default, or :none.

with_caret
Boolean

Whether or not a caret should be rendered in the button.

system_arguments

Slots

button

Required trigger for the dropdown. Has the same arguments as Primer::ButtonComponent, but it is locked as a summary tag.

NameRequiredDescription
aria_label_open
String

Defaults to "Close". Value to announce when menu is open.

aria_label_closed
String

Defaults to "Open". Value to announce when menu is closed.

Required context menu for the dropdown.

NameRequiredDescription
as
Symbol

When as is :list, wraps the menu in a <ul> with a <li> for each item.

direction
Symbol

One of :e, :ne, :s, :se, :sw, or :w.

scheme
Symbol

Pass :dark for dark mode theming

header
String

Optional string to display as the header

system_arguments

Items to be rendered in the Dropdown menu.

This component is part of Dropdown and should not be used as a standalone component.

NameRequiredDescription
as
Symbol

When as is :list, wraps the menu in a <ul> with a <li> for each item.

direction
Symbol

One of :e, :ne, :s, :se, :sw, or :w..

header
String

Header to be displayed above the menu.

system_arguments

items

NameRequiredDescription
tag
Symbol

One of :a, :button, or :summary..

divider
Boolean

Whether the item is a divider without any function.

system_arguments