ProviderPicker

Choosing a provider from any number of them: connected ones first with their key counts, then the rest.

View source
Anthropic1 keyOpenAI2 keys
Amazon BedrockAssemblyAIAzureBaidu QianfanBasetenCartesiaCerebrasCloudflare AI GatewayCohereDeepgramDeepInfraDeepSeekFireworks AIGemini Enterprise Agent PlatformGoogle AI StudioGroqHugging FaceIONOS AI Model HubJina AIMiniMaxMistralMoonshotNebius Token FactoryNovita AINVIDIAOllama CloudOpenRouterOVHcloud AI EndpointsPerplexityQwenCloudReplicateSambaNovaScalewaySiliconFlowSpaceXStandard ComputeStepFunTencent TokenHubTogether AITypeSafeUpstageVeniceVercelVolcengine ArkVoyage AIZ.ai
import { ProviderPicker } from "@logicplanes/kaeso-ui";

Props

  • allLabel
    string

    Select 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-label
    string

    What 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.

  • autoFocus
    boolean

    List only: focuses the search field when it appears.

  • description
    ReactNode

    One sentence of help under the label.

  • disabled
    boolean

    Turns it off: it can't be used, and it looks dimmed.

  • label
    ReactNode

    The 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 null for allLabel.

  • optional
    boolean

    Adds “Optional” to the label, for forms where most fields are required.

  • ordered
    boolean

    Keeps the providers in the order given instead of A to Z, for a list whose last entry, such as “Other”, must stay last.

  • placeholder
    string

    The search field's placeholder; in a pill without allLabel, also the text shown while nothing is chosen.

  • providers
    ProviderPickerOption[]

    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.

  • required
    boolean

    Marks it as required in a form.

  • size
    "md" | "sm"

    Select only: the height of the pill.

  • value
    string | null

    The chosen provider's id, when you control it.