theReactSelect/Playground

Configuration

Styling

Basic Options

Display Options

Live Preview

Interact with the component to see it in action

Current Value:
undefined

Generated Code

Copy and paste this code into your project

import { Select } from 'thereactselect';
import { useState } from 'react';

const options = [
  { value: "apple", label: "Apple" },
  { value: "banana", label: "Banana" },
  { value: "orange", label: "Orange" },
  { value: "grape", label: "Grape" },
  { value: "strawberry", label: "Strawberry" },
  { value: "watermelon", label: "Watermelon" },
];

function MyComponent() {
  const [value, setValue] = useState<string | number | undefined>(undefined);

  return (
    <Select
      options={options}
      value={value}
      onValueChange={setValue}
    />
  );
}

Active Configuration

variant
"default"
size
"default"
multiple
✗ false
searchable
✗ false
clearable
✗ false
disabled
✗ false
required
✗ false
error
✗ false
success
✗ false
loading
✗ false
numbered
✗ false
show Badges
✗ false
show Icons
✗ false
show Descriptions
✗ false
use Groups
✗ false
show Group Headers
✓ true
group Dividers
✗ false
select All
✗ false
selected Items Display
"badges"
show Item Clear Buttons
✓ true
max Selected Items To Show
3
close On Select
✓ true
scrollable
✓ true
max Height
300
placeholder
"Select an option..."
search Placeholder
"Search..."
no Options Message
"No options available"
no Search Results Message
"No results found"
select All Label
"Select All"
badge Variant
"default"