React Select Plugin
@vibeflui/react-select registers a React Select field adapter under the react-select key.
Install
BASH
npm install @vibeflui/core @vibeflui/react-select react-selectreact-select is an optional peer dependency in package metadata, but the field adapter needs it to render.
Public exports
| Export | Purpose |
|---|---|
createReactSelectPlugin | Creates a plugin that registers React Select field adapters. |
ReactSelectField | The field adapter component. |
reactSelectAdapterKeys | Adapter key list: react-select, react-select-async, react-select-creatable. |
Registered slots
| Slot | Keys |
|---|---|
fieldAdapters | react-select by default, plus custom adapters overrides. |
messages | optionLoadError |
Minimal setup
TSX
import { FluiKit, FluiKitProvider } from "@vibeflui/core";
import { createReactSelectPlugin } from "@vibeflui/react-select";
const reactSelectPlugin = createReactSelectPlugin();
export function UsersPage() {
return (
<FluiKitProvider plugins={[reactSelectPlugin]}>
<FluiKit schema={usersSchema} />
</FluiKitProvider>
);
}Schema usage
TS
export const usersSchema = {
resource: "users",
form: {
fields: [
{
name: "role",
label: "Role",
type: "select",
adapter: "react-select",
options: [
{ label: "Admin", value: "admin" },
{ label: "Editor", value: "editor" }
]
},
{
name: "tags",
label: "Tags",
type: "multiselect",
adapter: "react-select",
options: [
{ label: "Internal", value: "internal" },
{ label: "Beta", value: "beta" }
]
}
]
},
registry: {
fieldAdapters: ["react-select"]
}
} as const;Value behavior
Single selects emit the selected option value. multiselect and tags fields emit an array of selected values.
Common mistakes
- Use a normal field type such as
select,multiselect, ortags, then setadapter: "react-select". react-select-asyncandreact-select-creatableare adapter key types, but the default plugin registers onlyreact-selectunless custom adapters are passed.