Skip to main content

placeholder

Description

Optional. Sets a placeholder for the text field

Usage

placeholder?: string;

Default value

"Click to select"

Example

const dataset = [
{ id: 1, label: "First option" },
{ id: 2, label: "Second option" },
{ id: 3, label: "Third option" }
];

export default function App() {
return (
<div>
<RichSelect options={dataset} placeholder="Select an option" />
</div>
);
}

Details

For a placeholder to be visible in the input, a rich select should be initialized without the initial value specified.

Related article: Adding a placeholder for the text field