ProviderPicker
Choosing a provider from any number of them: connected ones first with their key counts, then the rest.
function Grid() {
const [provider, setProvider] = useState<string | null>(null);
return (
<div className="w-512 max-w-full">
<ProviderPicker appearance="grid" aria-label="Provider" providers={providers} value={provider} onValueChange={setProvider} />
</div>
);
}import { ProviderPicker } from "@logicplanes/kaeso-ui";Props
allLabelstringSelect only: a first option for no provider in particular, such as "All providers"; choosing it reports
null.appearance"list" | "grid" | "select"An always-open list for a dialog step, tiles with each provider's mark for a dialog's first step, or a pill that opens the list.
aria-labelstringWhat the picker is for, when there is no visible label: it names the list, and the pill, named by the provider it shows, reads it as its description.
autoFocusbooleanList only: focuses the search field when it appears.
descriptionReactNodeOne sentence of help under the label.
disabledbooleanTurns it off: it can't be used, and it looks dimmed.
labelReactNodeThe visible label.
layout"horizontal" | "vertical"The label above the control (
vertical) or beside it (horizontal).onChoose((id: string) => void)With
grid: called when a tile is pressed or clicked, not when the arrow keys move the choice, so a dialog step can continue at once.onValueChange((id: string | null) => void)Called with the chosen provider's id, or
nullforallLabel.optionalbooleanAdds “Optional” to the label, for forms where most fields are required.
orderedbooleanKeeps the providers in the order given instead of A to Z, for a list whose last entry, such as “Other”, must stay last.
placeholderstringThe search field's placeholder; in a pill without
allLabel, also the text shown while nothing is chosen.providersProviderPickerOption[]The providers: id, name, whether the organization has connected it, a short hint such as its key count, and an icon for a choice without a mark, such as any other server.
requiredbooleanMarks it as required in a form.
size"md" | "sm"Select only: the height of the pill.
valuestring | nullThe chosen provider's id, when you control it.