ContactPanel
Props, styling and a live ContactPanel example.
Customize
Loads the contact. Defaults to the inbox source's `contact()`.
Extra content under the details, such as your CRM fields.
Actions under the name, for example a `<CallButton/>`.
React only: @polymorfa/elements has no element for ContactPanel.
npm install @polymorfa/react@dev @polymorfa/browser@devimport { PolymorfaProvider, ContactPanel } from "@polymorfa/react";
const appearance = { theme: "light", variables: { colorPrimary: "#635bff" } };
export function ContactPanelExample({ conversation, selectedConversation }) {
return (
<PolymorfaProvider tokenEndpoint="/api/polymorfa/token" appearance={appearance}>
<ContactPanel
conversation={selectedConversation}
>
Customer since 2024
</ContactPanel>
</PolymorfaProvider>
);
}ContactPanel from @polymorfa/react. Choose props and styles above; the preview stays visible in every code view.
Props#
conversationInboxConversationrequiredConversation whose contact to show.
load(conversation: InboxConversation, signal: AbortSignal) => Promise<InboxContact | undefined>Loads the contact. Defaults to the inbox source's
contact().Default The inbox source's
contact()onClose() => voidShows a close button.
childrenReactNodeExtra content under the details, such as your CRM fields.
actionsReactNodeActions under the name, for example a
<CallButton/>.classNamestringRoot class and slot classes.
classNamesSlotClassNamesRoot class and slot classes.
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.