Lightning-fast, elegantly designed select components for React. Built with TypeScript, Tailwind CSS, and modern best practices.
Wanna build your own version?
Go to playgroundnpm install thereactselect
import { Select } from 'thereactselect';
import { useState } from 'react';
const options = [
{ value: "apple", label: "Apple", description: "A sweet red fruit" },
{ value: "banana", label: "Banana", description: "A yellow tropical fruit" },
{ value: "orange", label: "Orange", description: "A citrus fruit" },
];
function MyComponent() {
const [value, setValue] = useState();
return (
<Select
options={options}
placeholder="Select a fruit..."
searchable
clearable
onValueChange={setValue}
value={value}
/>
);
}
Explore different variations and use cases
Simple single selection with clean styling
Select multiple options with visual indicators
Multi-select with convenient select all option
Type to filter through options quickly
Easy to clear selection with clear button
Rich options with custom icons and descriptions
Various sizes to fit your design needs
Various styling variants for different use cases
Error and success states for form validation
Organize options into logical groups
Display numbers next to each option
Complete props and configuration options
Property | Type | Default | Description |
---|---|---|---|
options | SelectOption[] | - | Array of options to display in the dropdown |
groups | SelectGroup[] | - | Array of grouped options (alternative to options) |
value | string | number | (string | number)[] | - | Currently selected value(s) |
defaultValue | string | number | (string | number)[] | - | Default selected value(s) |
placeholder | string | Select... | Placeholder text when no option is selected |
multiple | boolean | false | Enable multiple selection mode |
selectAll | boolean | false | Show select all option in multi-select mode |
selectAllLabel | string | "Select All" | Label text for the select all option |
disabled | boolean | false | Disable the entire select component |
required | boolean | false | Mark the field as required |
error | boolean | false | Show error state styling |
success | boolean | false | Show success state styling |
loading | boolean | false | Show loading state with spinner |
variant | "default" | "outline" | "ghost" | "filled" | "default" | Visual variant of the select component |
size | "default" | "sm" | "lg" | "xl" | "default" | Size variant of the select component |
searchable | boolean | false | Enable search/filter functionality |
searchPlaceholder | string | "Search..." | Placeholder text for search input |
clearable | boolean | false | Show clear button to reset selection |
closeOnSelect | boolean | true | Close dropdown after selecting an option |
selectedItemsDisplay | "badges" | "text" | "count" | "badges" | How to display selected items in multi-select mode |
showItemClearButtons | boolean | true | Show individual clear buttons on selected item badges |
maxSelectedItemsToShow | number | 3 | Maximum number of selected items to show before showing count |
numbered | boolean | false | Show numbers next to each option |
showBadges | boolean | false | Show badges on options (if option has badge property) |
showIcons | boolean | false | Show icons on options (if option has icon property) |
showDescriptions | boolean | false | Show descriptions on options (if option has description property) |
onValueChange | (value: any) => void | - | Callback when selection changes |
onSearchChange | (search: string) => void | - | Callback when search input changes |
onOpenChange | (open: boolean) => void | - | Callback when dropdown open state changes |
onOptionSelect | (option: SelectOption) => void | - | Callback when an option is selected |
onClear | () => void | - | Callback when selection is cleared |