Lexxy API
Per-option reference for the Lexxy field. For setup and worked examples, see the Lexxy guide.
Options are passed to the field declaration in an Avo resource:
field :body, as: :lexxy, always_show: true, markdown: falseShared options such as placeholder, html, readonly, and disabled are covered in Common field options. Read-only or disabled fields use the display component on edit forms.
Content display and attachments
-> always_show
Displays the full content on the Show view instead of a collapsed preview with expansion controls.
field :body, as: :lexxy, always_show: true- Type:
Boolean - Default:
false
-> attachments_disabled
Disables attachments, including uploads through the toolbar, paste, and drag and drop. Also hides the Media Library button.
field :body, as: :lexxy, attachments_disabled: true- Type:
Booleanornil - Default:
nil, resolved tofalsefor Action Text attributes andtrueotherwise. - Values:
truedisables attachments;falseenables them;niluses attribute detection.
Plain columns
Enabling attachments on a plain column can leave orphaned blobs: Lexxy relies on Action Text to associate uploaded blobs with the saved record.
Editor configuration
These options are forwarded to Lexxy as element attributes. Avo converts snake_case names to dashed names, leaves Strings unchanged, converts Symbols to Strings, and JSON-encodes other values. It does not validate their types or contents. See the Lexxy documentation for the upstream configuration contract.
All editor options are unset by default in Avo (nil, with no attribute emitted). The effective defaults below describe Lexxy's built-in default preset; global Lexxy.configure settings and a selected preset can change them.
-> preset
Selects a named preset registered with Lexxy.configure.
field :body, as: :lexxy, preset: "default"- Type:
StringorSymbol - Default:
nilin Avo; Lexxy selects"default". - Values: A registered preset name.
-> markdown
Controls Markdown shortcuts. Shortcuts also require rich text to be enabled.
field :body, as: :lexxy, markdown: false- Type:
Boolean - Default:
nilin Avo;truein Lexxy's default preset.
-> rich_text
Controls rich text editing. Disabling it also disables the rich text toolbar and Markdown shortcuts.
field :body, as: :lexxy, rich_text: false- Type:
Boolean - Default:
nilin Avo;truein Lexxy's default preset.
-> multi_line
Controls whether the editor accepts multiple lines.
field :body, as: :lexxy, multi_line: false- Type:
Boolean - Default:
nilin Avo;truein Lexxy's default preset.
-> headings
Sets the heading tags available in the heading menu.
field :body, as: :lexxy, headings: ["h2", "h3"]- Type:
Array of Strings - Default:
nilin Avo;["h2", "h3", "h4"]in Lexxy's default preset.
-> toolbar
Controls toolbar visibility, configuration, or selection of an external toolbar by element ID.
field :body, as: :lexxy, toolbar: false| Value | Behavior |
|---|---|
false | Hides the toolbar. |
true | Uses a toolbar inside the editor or creates the default toolbar. |
Hash | Configures the generated toolbar through Lexxy's toolbar settings. |
String | Selects an existing toolbar by its HTML element ID. |
- Type:
Boolean,Hash, orString - Default:
nilin Avo;{upload: "both"}in Lexxy's default preset.
-> highlight
Configures text and background highlight palettes through Lexxy's buttons and permit settings. This is text highlighting, not code syntax highlighting.
field :body, as: :lexxy, highlight: {buttons: {color: ["red"]}}- Type:
Hash - Default:
nilin Avo; Lexxy's built-in text/background color palettes with empty additionalpermitlists.
-> permitted_attachment_types
Restricts accepted attachment content types. The restriction only applies when attachments are enabled.
field :body, as: :lexxy, permitted_attachment_types: ["image/png", "image/jpeg"]- Type:
Array of Strings, whitespace-separatedString, ornil - Default:
nilin Avo and Lexxy, allowing all content types when attachments are enabled. - Values: Exact MIME types; Lexxy compares content types against the list, not wildcard patterns.
Client-side restriction
This option filters content types in the editor. It is not a substitute for server-side upload validation.