Skip to content
Shortcut: /, ⌘K or Ctrl+K

DialPad

Props, styling and a live DialPad example.

View as Markdown
DialPad
Sample data
@polymorfa/react

Customize

Prefill the number field.

Offer a video-call button. Default `true`. Set it to `false` for numbers whose calls cannot carry video.

Called once the call is actually placed, not when a placement fails.

React only: @polymorfa/elements has no element for DialPad.

DialPadExample.jsx
npm install @polymorfa/react@dev @polymorfa/browser@dev
import { PolymorfaProvider, DialPad } from "@polymorfa/react";

const appearance = { theme: "light", variables: { colorPrimary: "#635bff" } };

export function DialPadExample({ calls }) {
  return (
    <PolymorfaProvider tokenEndpoint="/api/polymorfa/token" appearance={appearance}>
      <DialPad
        controller={calls}
        defaultValue="+15550001042"
        allowVideo
      />
    </PolymorfaProvider>
  );
}

DialPad from @polymorfa/react. Choose props and styles above; the preview stays visible in every code view.

Props#

  • defaultValuestring

    Prefill the number field.

  • allowVideoboolean

    Offer a video-call button. Default true. Set it to false for numbers whose calls cannot carry video.

    Default true

  • onPlaced(to: string) => void

    Called once the call is actually placed, not when a placement fails.

  • classNamestring
  • controllerCallsController
  • createController() => CallsController

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.