MultiSelect
Multiple choice with search; selections show as chips.
Multiple choice with a search box. Selections appear as chips on the trigger, and anything past
maxCount collapses into a “+N”.
export const client = "only";
import { useState } from "react";
import { MultiSelect } from "@squadbase/vantage/components";
const options = [
{ value: "active", label: "有効" },
{ value: "pending", label: "保留" },
{ value: "inactive", label: "停止" },
{ value: "error", label: "エラー" },
];
export default function Example() {
const [value, setValue] = useState(["active", "pending"]);
return (
<MultiSelect
className="w-72"
options={options}
value={value}
onChange={setValue}
placeholder="状態で絞り込む"
maxCount={2}
/>
);
}
import { MultiSelect } from "@squadbase/vantage/components";
import type { SelectOption, SelectOptionGroup } from "@squadbase/vantage/components";
PropType
options?SelectOption[] | SelectOptionGroup[]
The options; an array of groups adds headings.
Type
SelectOption[] | SelectOptionGroup[]value?string[]
The selected values.
Type
string[]onChange?(value: string[]) => void
Fired on change.
Type
(value: string[]) => voidmaxCount?number
How many chips to show before collapsing to "+N".
Type
numberonSearch?(query: string) => void
Called on every keystroke — for server-side search.
Type
(query: string) => voidisLoading?boolean
Options are being fetched.
Type
booleanplaceholder?string
Trigger text before anything is chosen.
Type
stringsearchPlaceholder?string
Placeholder for the search box.
Type
stringemptyText?string
Shown when nothing matches.
Type
stringdisabled?boolean
Disable interaction.
Type
booleanInside a filter row, FilterBar’s FilterBarMultiSelect handles
the value plumbing for you.