type

Admin

Change how a rich-text editor looks in the admin without changing what it stores.

Example

go
richtext.Field("content", richtext.Config{
  Admin: richtext.Admin{
    FixedToolbar: true,
    HideGutter:   true,
  },
})

Properties

PropertyTypeDescription
FixedToolbarboolPins formatting controls above the editor. The toolbar over selected text still appears.
HideGutterboolRemoves the line and indent along the editor's edge; block handles move outside the text.
HideDraggableBlockElementboolHides the handle for dragging a block. Alt+Shift+Arrow keys still move blocks.
HideAddBlockButtonboolHides the + button beside the hovered block. The / menu still inserts blocks.
HideInsertParagraphAtEndboolHides 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"` }

Source plugins/richtext/richtext.go:53

Related guides