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

CallControls

Props, styling and a live CallControls example.

View as Markdown
CallControls
Sample data
@polymorfa/react

Customize

Hide the camera control even when the call can carry video.

Show a Leave button that closes only this connection. Defaults to showing it on calls nobody claimed, where others can stay in the call. Never shown on a call this client placed that has not connected: nobody else is on it, so the red button ends it. The red button always ends the call for everyone.

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

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

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

export function CallControlsExample({ calls }) {
  return (
    <PolymorfaProvider tokenEndpoint="/api/polymorfa/token" appearance={appearance}>
      <CallControls
        controller={calls}
        disableVideo={false}
        showLeave
      />
    </PolymorfaProvider>
  );
}

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

Props#

  • classNamestring
  • disableVideoboolean

    Hide the camera control even when the call can carry video.

    Default false

  • showLeaveboolean

    Show a Leave button that closes only this connection. Defaults to showing it on calls nobody claimed, where others can stay in the call. Never shown on a call this client placed that has not connected: nobody else is on it, so the red button ends it. The red button always ends the call for everyone.

    Default On calls nobody claimed

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