Dropdown

Ready

The use of dropdowns has its advantages but it depends on the screen support. Dropdowns are a standard widget, so the users know how to interact with them. The options available in a dropdown component are static, preventing erroneous data entered by the user since it only shows a range of correct values for that input.

Props

NameDefaultDescription
options: object[]An array of objects representing the options. Each object has the following properties:
  • label: Option display value.
  • icon: Element or path used as the icon that will be placed next to the option label.
  • value: Option inner value.
optionsIconPosition: 'before' | 'after''before'In case options include icons, whether the icon should appear after or before the label.
icon: node | stringElement or path used as the icon that will be placed next to the dropdown label.
iconPosition: 'before' | 'after''before'Whether the icon should appear after or before the label.
label: stringText to be placed within the dropdown.
caretHidden: booleanfalseWhether the arrow next to the label must be displayed or not.
disabled: booleanfalseIf true, the component will be disabled.
expandOnHover: booleanfalseIf true, the options are showed when the dropdown is hover.
onSelectOption: functionThis function will be called every time the selection changes. The value of the selected option will be passed as a parameter.
margin: string | objectSize of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
size: string'fitContent'Size of the component ('small' | 'medium' | 'large' | 'fitContent' | 'fillParent' ).
tabIndex: number0Value of the tabindex.

Examples

Basic usage

Icons