Carregando…
Carregando…
Carregando…Multi-select combobox with tag chips, keyboard navigation, max selection and states.
$ npx kikitocn add combobox@/lib/utilsimport { Combobox } from "@/components/ui/cn/combobox/Combobox";
export function ComboboxExample() {
return (
<Combobox />
);
}| Prop | Tipo | Padrão | Descrição |
|---|---|---|---|
options* | ComboboxOption[] | — | Lista de opções: { value, label, disabled? } |
value | string[] | undefined | Valores selecionados (controlled) |
defaultValue | string[] | [] | Valores iniciais (uncontrolled) |
onChange | (values: string[], options: ComboboxOption[]) => void | undefined | Callback quando a seleção muda |
placeholder | string | 'Select…' | Texto placeholder quando vazio |
label | string | undefined | Label acima do campo |
helperText | string | undefined | Texto de ajuda abaixo do campo |
errorText | string | undefined | Texto de erro (substitui helperText) |
state | 'default' | 'error' | 'success' | 'default' | Estado visual do campo |
disabled | boolean | false | Desabilita o campo |
maxSelected | number | undefined | Limite máximo de seleções |
Multi-select
Single (maxSelected=1)