Skip to main content

Dropdown Menu

Dropdown menus allow users to select an option from a list that appears when the menu is clicked or tapped.

https://www.figma.com/design/JesXQFLaPJLc1BdBM4sisI/%F0%9F%A6%93-ZDS---Components?node-id=22664-32734

Demo

zeta-web v1.0.0
Web Components

Zeta Dropdown Menu Button places a button that when clicked opens a dropdown menu containing the items passed into it through the items prop.

Storybook

https://design.zebra.com/web/storybook/?path=/docs/components-dropdown--docs

Attributes

NameDescriptionTypeDefault
matchParentWidthWhether the dropdown menu should match the width of its parent. Enabled by default. If disabled, the dropdown menu will size to fit its content.booleantrue
buttonTextMatchesSelectedWhether the button text should update to match the selected item. Default is true. Only applicable for the text-dropdown type.booleantrue
defaultTextThe default text to display when no item is selected. Defaults to an empty string if nothing is set.string""
openControls the state of the dropdown menu. Default is false.booleanfalse
itemsArray of items to populate the dropdown. Includes label, icon (optional), checked (optional), disabled (optional), and onClick (optional) properties.Array\<ZetaDropdownItem\>[ { label: "Auto Item", icon: undefined, checked: false } ]
typeThe type of dropdown. Options are "text-dropdown", "checkbox-dropdown", and "radio-dropdown". Default is "text-dropdown".'number' | 'text' | 'checkbox' | 'textarea' | 'password' | 'time' | 'date' | 'radio' | 'search' | 'text-dropdown' | 'checkbox-dropdown' | 'radio-dropdown' | 'slider' | 'range-selector' | 'select' | 'stepper' | 'integer'"text-dropdown"
directionThe direction of the droppable relative to the anchor. Defaults to bottom if left undefined."left" | "right" | "bottom" | "top""bottom"

Inherited Attributes

NameDescriptionTypeDefaultInherited From
flavorThe flavor of the dropdown button. Default is "primary".'primary' | 'positive' | 'negative' | 'outline' | 'outline-subtle' | 'text' | 'subtle'"primary"Flavored
nameThe name of the dropdown menu button for form control. Default is "default".string"default"FormField
autoCapitalizeWhether inputted text is automatically capitalized and how. Only takes effect on non-keyboard entry"none" | "off" | "sentences" | "on" | "words" | "characters" | undefinedundefinedFormField
autoCompleteAutoFill | undefinedundefinedFormField
idThe id of the form control.string""FormField
requiredIndicates whether the form control is required to be filled out before submitting the form.booleanfalseFormField
valueThe value of the Form Control that is submitted when part of a form.string | nullnullFormField
checkedThe state of the Switch or Checkbox that is submitted when part of a form.booleanundefinedFormField
indeterminateThe state of the Switch or Checkbox defined by a mixed or unknown state.booleanfalseFormField
placeholderPlaceholder text shown when value is empty.string | undefinedundefinedFormField
minThe minimum value for number inputsnumber | undefinedundefinedFormField
maxThe maximum value for number inputsnumber | undefinedundefinedFormField
readOnlyPlaceholder text shown when value is empty.boolean | undefinedundefinedFormField
spellCheckWhether to spellcheck the inputboolean | "default" | undefinedundefinedFormField
disabledBoolean for if component is disabled.This will apply disabled styles.booleanfalseFormField
roundedWhether the component is rounded or sharp.When true, rounded will set the border radius of the first child, and any children with class 'contourable-target' to --radius-minimal.Otherwise, this value will be --radius-none.boolean | undefinedtrueContourable
sizeSize of componentSizeType"medium"Size