theReactSelect

Beautiful Select Components

Lightning-fast, elegantly designed select components for React. Built with TypeScript, Tailwind CSS, and modern best practices.

Lightning Fast
Beautiful Design
TypeScript Ready
Searchable
Accessible
Customizable

Wanna build your own version?

Go to playground

Quick Start

Installation

npm install thereactselect

Basic Usage

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}
    />
  );
}

Examples

Explore different variations and use cases

Basic Select

Simple single selection with clean styling

Multi Select

Select multiple options with visual indicators

Multi Select with Select All

Multi-select with convenient select all option

Searchable Select

Type to filter through options quickly

Clearable Select

Easy to clear selection with clear button

With Icons & Descriptions

Rich options with custom icons and descriptions

Different Sizes

Various sizes to fit your design needs

Different Variants

Various styling variants for different use cases

States

Error and success states for form validation

Grouped Options

Organize options into logical groups

Numbered Options

Display numbers next to each option

API Reference

Complete props and configuration options

PropertyTypeDefaultDescription
optionsSelectOption[]-Array of options to display in the dropdown
groupsSelectGroup[]-Array of grouped options (alternative to options)
valuestring | number | (string | number)[]-Currently selected value(s)
defaultValuestring | number | (string | number)[]-Default selected value(s)
placeholderstringSelect...Placeholder text when no option is selected
multiplebooleanfalseEnable multiple selection mode
selectAllbooleanfalseShow select all option in multi-select mode
selectAllLabelstring"Select All"Label text for the select all option
disabledbooleanfalseDisable the entire select component
requiredbooleanfalseMark the field as required
errorbooleanfalseShow error state styling
successbooleanfalseShow success state styling
loadingbooleanfalseShow 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
searchablebooleanfalseEnable search/filter functionality
searchPlaceholderstring"Search..."Placeholder text for search input
clearablebooleanfalseShow clear button to reset selection
closeOnSelectbooleantrueClose dropdown after selecting an option
selectedItemsDisplay"badges" | "text" | "count""badges"How to display selected items in multi-select mode
showItemClearButtonsbooleantrueShow individual clear buttons on selected item badges
maxSelectedItemsToShownumber3Maximum number of selected items to show before showing count
numberedbooleanfalseShow numbers next to each option
showBadgesbooleanfalseShow badges on options (if option has badge property)
showIconsbooleanfalseShow icons on options (if option has icon property)
showDescriptionsbooleanfalseShow 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