SubComponents

Header, Actions and Divider.

This subcomponents are extended from the Menu. This subcomponents docs can be found in the Menu subcomponents page. They work in the same way they are being used there.

Control

The control subcomponent is required to render the Control of the TextInput component. This component extends the native divarrow-up-right tag props.

Control API

triangle-exclamation
Props
Type
Required

children

ReactNode

βœ…

placeholder

string

❌

defaultValue

string

❌

defaultOpen

boolean

❌

value

string

❌

showModeOption

'value' | 'children' | 'customValue'

❌

hasError

boolean

❌

isDisabled

boolean

❌

isReadOnly

boolean

❌

menuWidth

string

❌

chevron-rightchildrenhashtag

The children of the Control subcomponent should always be the Dropdown.Option subcomponent.

chevron-rightplaceholderhashtag

This will be rendered in the controlled approach, in the case the initial value is undefined.

chevron-rightdefaultValuehashtag

Used to render a default value when using the uncontrolled approach.

chevron-rightvaluehashtag

Used when having a controlled approach to pass the rendered value.

chevron-rightshowModeOptionhashtag

This property determines how the content should be displayed for each option within the Dropdown component. By default, the 'value' option is utilized, simply rendering the value of the prop. However, if you opt for the 'children'option, it will render the children contained within each option. Alternatively, if you select the 'customOption' choice, it will render the customOption value of each individual Dropdown.Option.

Option

The Option Subcomponent receives a children that renders content that when clicked, closes the Menu automatically.

Option API

This component extends the native <div>arrow-up-right API. That's why the className prop is not included in the table.

Props
Type
Required

value

string

βœ…

layout

'horizontal' | 'vertical'

❌

children

ReactNode

❌

customValue

ReactNode

❌

isDisabled

boolean

❌

isSelected

boolean

❌

isHidden

boolean

❌

onClick

(e: MouseEvent) => void;

❌

chevron-rightvaluehashtag

A prop required to change the selected option, wether it's an uncontrolled approach or a controlled approach.

chevron-rightlayouthashtag

Controls the layout of the option.

chevron-rightchildrenhashtag

A string or a HTML structure passed that is rendered

chevron-rightcustomValuehashtag

A custom string or value or structure that will change the value of the Dropdown if the showModeOption chose this prop.

chevron-rightisDisabled, isSelected, isHiddenhashtag

Changes the CSS to remark if it's disabled, selected or hidden.

chevron-rightonClickhashtag

Function that can be executed when the Option is clicked.

HelpText

The HelpText subcomponent extends the SDS HelpText component. See for reference: HelpText

Label

The Label subcomponent extends the SDS label component. See for reference: Label

Last updated