AI Plugin Dictionary
The dictionary defines the text strings used throughout the AI plugin’s UI.
Pass these keys to Puck’s dictionary prop, alongside Puck’s own strings. Use this to implement localization or to override default messages:
import { Puck } from "@puckeditor/core";
import { createAiPlugin } from "@puckeditor/plugin-ai";
<Puck
plugins={[createAiPlugin()]}
dictionary={{
"plugin-ai-prompt-placeholder": "What should we build?",
}}
/>;When a default string contains a template variable (e.g. {seconds}), you can use that to position the variable in your string:
<Puck
dictionary={{
"plugin-ai-chat-msg-thought-for": "Thought for {seconds} seconds",
}}
/>The plugin’s label is set with the label param.
Tokens
Tokens follow a plugin-ai-{area}-{name}-{variant} format.
Some tokens set an element’s HTML title attribute, a tooltip that only appears on hover, rather than always-visible text. These are marked (tooltip) below.
Placeholder
| Token | Default | Used for |
|---|---|---|
plugin-ai-placeholder-title | "Build with AI" | Empty chat title |
plugin-ai-placeholder-description | "Describe what you want to create or change." | Empty chat description |
plugin-ai-placeholder-write-prompt | "Write a prompt" | Empty chat prompt button |
plugin-ai-placeholder-browse | "Browse" | Empty chat browse button |
Prompt
| Token | Default | Used for |
|---|---|---|
plugin-ai-prompt-placeholder | "What do you want to build?" | Prompt input placeholder |
plugin-ai-prompt-design-mode | "Design" | Design mode toggle |
plugin-ai-prompt-design-mode-enable | "Enable design mode" | Design mode toggle (tooltip) |
plugin-ai-prompt-design-mode-disable | "Disable design mode" | Design mode toggle (tooltip) |
Attachments
| Token | Default | Used for |
|---|---|---|
plugin-ai-prompt-attachment-attach | "Attach files" | Attach button (tooltip) |
plugin-ai-prompt-attachment-drop | "Attach file" | Overlay when dragging files over the prompt |
plugin-ai-prompt-attachment-item-failed | "Failed" | Attachment that failed to upload |
plugin-ai-prompt-attachment-item-remove | "Remove attachment" | Attachment remove button (screen readers) |
Errors
| Token | Default | Used for |
|---|---|---|
plugin-ai-prompt-error-uploading | "Wait for attachments to finish uploading." | Sending while attachments upload |
plugin-ai-prompt-error-attachment-failed | "Remove failed attachments before sending." | Sending with failed attachments |
plugin-ai-prompt-error-attachment-upload-failed | "One or more attachments failed to upload." | Upload errors |
plugin-ai-prompt-error-max-files | "You can attach up to {count} files per message." | Attaching too many files |
plugin-ai-prompt-error-max-size | "{name} exceeds the {limit} MB file size limit." | Attaching a file that’s too large |
plugin-ai-prompt-error-type | "Unsupported file type: {name}" | Attaching an unsupported file |
plugin-ai-prompt-error-dismiss | "Dismiss" | Error dismiss button (tooltip) |
Chat
Messages
| Token | Default | Used for |
|---|---|---|
plugin-ai-chat-msg-thinking | "Thinking..." | Waiting for a response |
plugin-ai-chat-msg-thought-for | "Thought for {seconds}s" | Finished reasoning |
plugin-ai-chat-msg-thought | "Thought for a while" | Finished reasoning without a duration |
plugin-ai-chat-msg-attachment | "Attachment" | Attachments without a filename |
Errors
| Token | Default | Used for |
|---|---|---|
plugin-ai-chat-error | "Something went wrong." | Failed responses |
plugin-ai-chat-error-retry | "Retry" | Retry button (tooltip) |
Components
| Token | Default | Used for |
|---|---|---|
plugin-ai-components-manage | "Manage components" | Design mode components button and modal |
plugin-ai-components-manage-empty | "No dynamic components" | Manage components modal without components |
plugin-ai-components-delete | "Delete" | Delete component buttons |
plugin-ai-components-delete-title | "Delete component" | Delete component modal title |
plugin-ai-components-delete-confirm | "Are you sure you want to delete {label}?" | Delete component modal |
plugin-ai-components-delete-cancel | "Cancel" | Delete component modal cancel button |