type
Admin
Change how a rich-text editor looks in the admin without changing what it stores.
Example
richtext.Field("content", richtext.Config{
Admin: richtext.Admin{
FixedToolbar: true,
HideGutter: true,
},
})Properties
| Property | Type | Description |
|---|---|---|
FixedToolbar | bool | Pins formatting controls above the editor. The toolbar over selected text still appears. |
HideGutter | bool | Removes the line and indent along the editor's edge; block handles move outside the text. |
HideDraggableBlockElement | bool | Hides the handle for dragging a block. Alt+Shift+Arrow keys still move blocks. |
HideAddBlockButton | bool | Hides the + button beside the hovered block. The / menu still inserts blocks. |
HideInsertParagraphAtEnd | bool | Hides the control below the last block that adds an empty paragraph. |
How it works
Each option matches a Payload lexicalEditor admin option or FixedToolbarFeature. Options are presentation only: validation, stored JSON, and generated types are unchanged.
Full signature
type Admin struct {
// FixedToolbar pins formatting controls above the editor. The toolbar that
// floats over selected text is still shown.
FixedToolbar bool `json:"fixedToolbar,omitempty"`
// HideGutter removes the vertical line and indent along the editor's
// starting edge. Block handles move outside the text.
HideGutter bool `json:"hideGutter,omitempty"`
// HideDraggableBlockElement hides the handle that drags a block to a new
// position. Editors can still move blocks with Alt+Shift+Arrow keys.
HideDraggableBlockElement bool `json:"hideDraggableBlockElement,omitempty"`
// HideAddBlockButton hides the + button beside the hovered block. The /
// menu still inserts blocks.
HideAddBlockButton bool `json:"hideAddBlockButton,omitempty"`
// HideInsertParagraphAtEnd hides the control below the last block that
// adds an empty paragraph.
HideInsertParagraphAtEnd bool `json:"hideInsertParagraphAtEnd,omitempty"`
}