IncomingCallCard
Props, styling and a live IncomingCallCard example.
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.
npm install @polymorfa/react@dev @polymorfa/browser@devimport { 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#
displayNamestringHuman name to show instead of the raw number, if the app knows one.
Default The number
avatarUrlstringAvatar image.
resolveAvatarAvatarResolverResolves an avatar for a number.
classNamestringexclusivebooleanClaim 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
falseresolveName(peer: string) => string | undefinedName for another waiting call in the "Other incoming calls" list.
controllerCallsControllercreateController() => CallsController
Types#
Named types used in the props above.
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.