# @gluestack-ui/select

> A universal headless select component for React Native, Next.js & React

Latest version **0.1.31** (published 2025-02-19) · 0 weekly downloads

## Install

```sh
npm install @gluestack-ui/select
pnpm add @gluestack-ui/select
yarn add @gluestack-ui/select
bun add @gluestack-ui/select
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.1.31 |
| Published | 2025-02-19 |
| First published | 2023-02-21 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 52 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5298 |
| Maintainers | vidhi499, rohit_singh, viraj-10, rayan1810, rajat693, surajahmedc, meenumakkar, madhavb230100, vaibhk002, daminipandey, amars29, geekgautam, sravankumarvelangi, gluestackadmin, geekashwini, mayankp06 |
| Keywords | react, native, react-native, select, gluestack-ui, universal, headless, typescript, component, android, ios, nextjs |

## Links

- npm: https://www.npmjs.com/package/@gluestack-ui/select
- Repository: https://github.com/gluestack/gluestack-ui
- Homepage: https://github.com/gluestack/gluestack-ui/tree/main/packages/unstyled/select#readme
- Issues: https://github.com/gluestack/gluestack-ui/issues
- npm.io page: https://npm.io/package/@gluestack-ui/select

## Dependencies (4)

- [@gluestack-ui/hooks](https://npm.io/package/@gluestack-ui/hooks.md) 0.1.13
- [@gluestack-ui/utils](https://npm.io/package/@gluestack-ui/utils.md) ^0.1.14
- [@react-native-aria/focus](https://npm.io/package/@react-native-aria/focus.md) ^0.2.9
- [@gluestack-ui/form-control](https://npm.io/package/@gluestack-ui/form-control.md) ^0.1.19

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.31 (latest) — 2025-02-19
- 0.1.30 — 2024-11-11
- 0.1.29 — 2024-08-28
- 0.1.28 — 2024-08-13
- 0.1.27 — 2024-07-08
- 0.1.26 — 2024-05-08
- 0.1.25 — 2024-03-18
- 0.1.24 — 2024-02-14
- 0.1.23 — 2024-02-12
- 0.1.22 — 2024-01-23
- 0.1.21 — 2023-12-27
- 0.1.20 — 2023-11-28
- 0.1.19 — 2023-10-20
- 0.1.18 — 2023-10-19
- 0.1.17 — 2023-10-19
- … 18 more at https://npm.io/package/@gluestack-ui/select/versions

## README

# `@gluestack-ui/select`

Select offers a dynamic and user-friendly way to present a list of options in a closed view, with the ability to expand and select items from a dropdown list.

## Installation

To install the component, run the following command in your terminal. This will add the component to your project's dependencies and allow you to use it in your project.

```sh
npx install @gluestack-ui/select
```

## Usage

Default styling of all these components can be found in the components/select file. For reference, you can view the [source code](https://github.com/gluestack/gluestack-ui/blob/main/example/storybook/src/ui-components/Select/styled-components/index.tsx) of the styled Select components.

```jsx
// import animation configured styled function
import { styled } from '../styled';

// import the styles
import {
  Root as StyledSelectRoot,
  Trigger as StyledSelectTrigger,
  Input as StyledSelectInput,
  Icon as StyledSelectIcon,
} from '../components/core/select/styled-components';

import {
  Root,
  Content,
  Item,
  ItemText,
  DragIndicator,
  IndicatorWrapper,
  Backdrop,
  Icon,
  FlatList,
  ScrollView,
  SectionHeaderText,
  SectionList,
  VirtualizedList,
} from '../components/core/actionsheet/styled-components';

// import the createSelect and createActionsheet function
import { createSelect } from '@gluestack-ui/select';
import { createActionsheet } from '@gluestack-ui/actionsheet';

// Understanding the API
const Actionsheet = createActionsheet({
  Root,
  Backdrop,
  Content,
  DragIndicator,
  IndicatorWrapper,
  Item,
  ItemText,
  Icon,
  ScrollView,
  VirtualizedList,
  FlatList,
  SectionList,
  SectionHeaderText,
  AnimatePresence: styled.Component,
});

const Select = createSelect(
  {
    Root: StyledSelectRoot,
    Trigger: StyledSelectTrigger,
    Input: StyledSelectInput,
    Icon: StyledSelectIcon,
  },
  {
    Portal: Actionsheet,
    Backdrop: Actionsheet.Backdrop,
    Content: Actionsheet.Content,
    DragIndicator: Actionsheet.DragIndicator,
    DragIndicatorWrapper: Actionsheet.DragIndicatorWrapper,
    Item: Actionsheet.Item,
    ItemText: Actionsheet.ItemText,
    ScrollView: Actionsheet.ScrollView,
    VirtualizedList: Actionsheet.VirtualizedList,
    FlatList: Actionsheet.FlatList,
    SectionList: Actionsheet.SectionList,
    SectionHeaderText: Actionsheet.SectionHeaderText,
  }
);

// Using the select component
export default () => (
  <Select isDisabled={isDisabled} isInvalid={isInvalid}>
    <SelectTrigger>
      <SelectInput placeholder="Select option" />
      <SelectIcon mr="$3">
        <Icon as={ChevronDownIcon} />
      </SelectIcon>
    </SelectTrigger>
    <SelectPortal>
      <SelectBackdrop />
      <SelectContent>
        <SelectDragIndicatorWrapper>
          <SelectDragIndicator />
        </SelectDragIndicatorWrapper>
        <SelectItem label="UX Research" value="UX Research" />
        <SelectItem label="Web Development" value="Web Development" />
      </SelectContent>
    </SelectPortal>
  </Select>
);
```

More guides on how to get started are available
[here](https://ui.gluestack.io/docs/).

---
_Source: https://npm.io/package/@gluestack-ui/select · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
