CallNumberPicker
Props, styling and a live CallNumberPicker example.
Customize
Select the existing Number client; never replace its token or session.
React only: @polymorfa/elements has no element for CallNumberPicker.
npm install @polymorfa/react@dev @polymorfa/browser@devimport { useState } from "react";
import { PolymorfaProvider, CallNumberPicker } from "@polymorfa/react";
const appearance = { theme: "light", variables: { colorPrimary: "#635bff" } };
export function CallNumberPickerExample({ numbers }) {
const [numberId, setNumberId] = useState("support");
return (
<PolymorfaProvider tokenEndpoint="/api/polymorfa/token" appearance={appearance}>
<style>{".number-picker { display: grid; gap: 6px; max-width: 320px; }\n.number-picker label { font-size: 13px; font-weight: 600; }\n.number-picker select { height: 40px; padding: 0 12px; border: 1px solid var(--pmfa-color-border); border-radius: var(--pmfa-radius-medium); background: var(--pmfa-color-background); color: var(--pmfa-color-foreground); font: inherit; }"}</style>
<CallNumberPicker
numbers={numbers}
value={numberId}
disabled={false}
className="number-picker"
onChange={(id) => setNumberId(id)}
/>
</PolymorfaProvider>
);
}CallNumberPicker from @polymorfa/react. Choose props and styles above; the preview stays visible in every code view.
Props#
numbersreadonly CallNumberOption[]requiredOne option per Number, each with its own Calls client controller.
valuestringrequiredSelected option
id.onChange(id: string) => voidrequiredSelect the existing Number client; never replace its token or session.
disabledbooleanDisables the picker.
Default
falseclassNamestringClass for the root.
Styling#
Use className, classNames (a class for any slot, typed SlotClassNames), appearance variables and element styles. The Style panel applies changes to the live component. See Appearance.
Setup#
Use the provider and server route for your application. The preview above uses local sample data and controllers. Chat controllers and inbox data sources keep your data separate from the UI.