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

IncomingCallCard

Props, styling and a live IncomingCallCard example.

View as Markdown
IncomingCallCard
Sample data
@polymorfa/react

Customize

Human name to show instead of the raw number, if the app knows one.

Claim the call when Answer is pressed, so other participants stop ringing and cannot join. Default `false`: others keep ringing and can join the answered call.

Name for another waiting call in the "Other incoming calls" list.

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

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

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

export function IncomingCallCardExample({ calls }) {
  return (
    <PolymorfaProvider tokenEndpoint="/api/polymorfa/token" appearance={appearance}>
      <IncomingCallCard
        controller={calls}
        displayName="Avery Morgan"
        exclusive={false}
      />
    </PolymorfaProvider>
  );
}

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

Props#

  • displayNamestring

    Human name to show instead of the raw number, if the app knows one.

    Default The number

  • avatarUrlstring

    Avatar image.

  • resolveAvatarAvatarResolver

    Resolves an avatar for a number.

  • classNamestring
  • exclusiveboolean

    Claim the call when Answer is pressed, so other participants stop ringing and cannot join. Default false: others keep ringing and can join the answered call.

    Default false

  • resolveName(peer: string) => string | undefined

    Name for another waiting call in the "Other incoming calls" list.

  • controllerCallsController
  • createController() => CallsController

Types#

Named types used in the props above.

@polymorfa/react
type AvatarResolver = (peer: string) => string | undefined | Promise<string | undefined>;

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.