Just another select component for React Native + Web.
npm install haya-selectJust another select component for React Native + Web.
- Documentation for the latest stable release
- Documentation for the main branch
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.
```
npm install haya-select
Run npx pod-install after installing the npm package.
`jsx
import {View} from "react-native"
import React from "react"
import HayaSelect from "haya-select"
export default function ExampleSelect() {
return (
{value: 1, text: "Option 1"},
{value: 2, text: "Option 2"}
]}
/>
)
}
`
When options is a callback, it can return either an array of options or an object with pagination metadata.
The callback receives the current searchValue, page, and optional values when loading default selections.
`jsx/api/options?query=${searchValue}&page=${page}
options={async ({searchValue, page}) => {
const response = await fetch()
const data = await response.json()
return {
options: data.options,
totalCount: data.totalCount,
page: data.page,
pageSize: data.pageSize
}
}}
/>
`
If totalCount and page` are provided, the options list shows pagination controls with previous/next buttons, a page range around the current page, and a "Page X of Y" label that can be clicked to enter a page number manually.
Contributions are very welcome! Please refer to guidelines described in the contributing guide.