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

TemplateManager

Props, styling and a live TemplateManager example.

View as Markdown
TemplateManager
Sample data
@polymorfa/react

Customize

Starting draft for "New template".

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

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

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

export function TemplateManagerExample() {
  return (
    <PolymorfaProvider tokenEndpoint="/api/polymorfa/token" appearance={appearance}>
      <TemplateManager />
    </PolymorfaProvider>
  );
}

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

Props#

  • newDraftTemplateDraft

    Starting draft for "New template".

  • classNamestring

    Root class and slot classes.

  • classNamesSlotClassNames

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