Skip to content

Dropdown.Options

The Dropdown.Options slot serves as the container for all the options within the Dropdown component.

To use Dropdown.Options, wrap it inside the Dropdown component.

import Dropdown from '@components/Basic/Dropdown/Dropdown';
const App = () => {
return (
<Dropdown>
<Dropdown.Options>
<Dropdown.Option selected value="red">red</Dropdown.Option>
<Dropdown.Option value="green">green</Dropdown.Option>
<Dropdown.Option value="blue">blue</Dropdown.Option>
</Dropdown.Options>
</Dropdown>
);
};
export default App;
Prop NameTypeDefaultDescription
styleJSX.CSSProperties{}Inline styles to apply directly to the dropdown options container element.
classstring""Additional CSS classes to apply to the dropdown options container element.
childrenJSX.Element""The children of Dropdown.Options should include all the Dropdown.Option slots.

This slot is used to add a new option to the Dropdown. It also allows customization of the option’s appearance.

Prop NameTypeDefaultDescription
styleJSX.CSSProperties{}Inline styles applied directly to the dropdown option element.
classstring""Additional CSS classes for the dropdown option element.
valuestringundefinedThe value associated with the dropdown option.
selectedbooleanfalseIndicates if the dropdown option is selected.
disabledbooleanfalseIndicates if the dropdown option is disabled.
class-selectedstring""Additional CSS classes applied when the dropdown option is selected.
class-disabledstring""Additional CSS classes applied when the dropdown option is disabled.
childrenJSX.Element""Content of the option, used to render text, HTML, or JSX elements within the option.
import Dropdown from '@components/Basic/Dropdown/Dropdown';
const App = () => {
return (
<Dropdown>
<Dropdown.Options>
<Dropdown.Option selected value="red">red</Dropdown.Option>
<Dropdown.Option disabled class-disabled="my-disabled-class" value="green">green</Dropdown.Option>
<Dropdown.Option value="blue">blue</Dropdown.Option>
</Dropdown.Options>
</Dropdown>
);
};
export default App;