Skip to content

About

Accessible, searchable React selects with single and multiple selection.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

RentnerSelect

CI CodeQL OpenSSF Scorecard npm version npm downloads MIT license

Accessible React select with search, typed single or multiple selection, native form support, and localization.

Installation

Requires React 19, React DOM 19, and Tailwind CSS 4.

npm install @rentnerkev/select
# or with Bun
bun add @rentnerkev/select

Import the package styles after Tailwind in your app stylesheet:

@import 'tailwindcss';
@import '@rentnerkev/select/tailwind.css';

Quick start

'use client'

import { useState } from 'react'
import { CustomSelect } from '@rentnerkev/select'

const options = [
    { value: 'design', label: 'Design' },
    { value: 'engineering', label: 'Engineering' },
]

export function TeamSelect() {
    const [team, setTeam] = useState('design')
    return (
        <CustomSelect
            label="Team"
            value={team}
            onValueChange={setTeam}
            options={options}
            locale="en"
        />
    )
}

Lists virtualize automatically from 250 options in CustomSelect and 1,000 in Combobox. The optional virtualized setting on either control or SelectProvider can force it on/off or configure row estimates and overscan. Only the visible rows and active keyboard option are mounted; the virtualizer and error tooltip are loaded on demand. See large-list usage.

Screenshots

Searchable contact choices
Searchable contact choices
Multiple selection
Multiple selection
Secondary option details
Secondary option details
Typed object values
Typed object values

Full API & usage · Local playground · MIT license

Run the playground from the repository root:

bun install --cwd playground
bun run playground:dev

AI and read-only MCP access

The separate @rentnerkev/select/ai entry is for Node.js and Bun tooling. It reads only this installed package's manifest, README, usage guide, and built TypeScript declarations. It does not import React, mount UI, run examples, perform network requests, or require an MCP runtime. Keep it in server/tooling code.

import {
    getPackageInfo,
    getPackageApi,
    getPackageDocumentation,
    searchPackageDocumentation,
    getPackageExamples,
} from '@rentnerkev/select/ai'

const info = getPackageInfo()
const api = getPackageApi() // All public typed subpaths and dependent declarations
const usage = getPackageDocumentation('usage') // Full guide, including CSS and providers
const readme = getPackageDocumentation('readme')
const matches = searchPackageDocumentation('messages') // Literal, case-insensitive lines
const examples = getPackageExamples() // Fenced examples from the usage guide

getPackageApi({ subpath: '.', symbol: 'CustomSelect' }) validates the symbol against the selected public entry and returns its complete declaration context. Unknown subpaths or symbols throw an error. File paths are not accepted. The ./ai entry itself is excluded from this UI API context. The manifest's exports map remains available through getPackageInfo().

Public website discovery is planned at llms.txt and the MCP endpoint. These addresses become available after the website deployment; this documentation does not claim the endpoint is already online. The website's read-only tools expose public package information, API declarations, usage guides, examples, and search, without accounts, write operations, or access to private project files. The installed /ai entry works locally without that service. Always use the documentation and declarations for the version installed in your project.

CustomSelect supports replaceable text slots, textOverflow, popup width, shared themes and control sizes. A separate generic Combobox<T> accepts external search results, with independent selected value and search text. Optional pure form adapters are available from @rentnerkev/select/form. See usage for contracts and examples.

Community

See Contributing, the Code of Conduct, Support, and the Security Policy.

About

Accessible, searchable React selects with single and multiple selection.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages