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

CallStage

Props, styling and a live CallStage example.

View as Markdown
CallStage
Sample data
@polymorfa/react

Customize

Label for a remote video tile; see {@link ParticipantVideoGridProps}.

Replace the media region without forking state. `remote` is the merged call audio; `videos` holds one stream per remote participant.

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

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

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

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

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

Props#

  • displayNamestring

    As for IncomingCallCard.

  • avatarUrlstring

    As for IncomingCallCard.

  • resolveAvatarAvatarResolver

    As for IncomingCallCard.

  • classNamestring
  • labelVideoParticipantVideoGridProps["labelVideo"]

    Label for a remote video tile; see ParticipantVideoGridProps.

  • renderMedia(streams: { readonly local?: MediaStream; readonly remote?: MediaStream; readonly videos: readonly { readonly key: string; readonly info: RemoteVideoInfo; readonly stream: MediaStream; }[]; }) => ReactNode

    Replace the media region without forking state. remote is the merged call audio; videos holds one stream per remote participant.

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