Skip to content

feat(richtext-lexical): add separate fields for icons in lexical blocks#15632

Open
VeiaG wants to merge 2 commits intopayloadcms:mainfrom
VeiaG:feat/richtext-lexical-add-icon-image-url
Open

feat(richtext-lexical): add separate fields for icons in lexical blocks#15632
VeiaG wants to merge 2 commits intopayloadcms:mainfrom
VeiaG:feat/richtext-lexical-add-icon-image-url

Conversation

@VeiaG
Copy link
Contributor

@VeiaG VeiaG commented Feb 14, 2026

This PR adds new iconImageURL and iconImageAltText fields to BlockConfig, allowing developers to specify separate images for:

  • Lexical editor icons (20x20px) - small icons displayed in slash menus and toolbars
  • Block drawer thumbnails (3:2 aspect ratio) - larger images shown in the block selection drawer

Why

Currently, imageURL serves dual purposes:

  1. Block selection drawer thumbnails (3:2 aspect ratio, e.g., 480x320px)
  2. Lexical editor icons (scaled down to 20x20px)

Citing documentation:

Display Contexts:
Block Selection Drawer: Images appear as thumbnails in a responsive grid when editors add blocks
Lexical Editor: Images are scaled down to 20x20px icons in menus and toolbars

This creates problem , where developer needs to choose either good looking icons (but worse UX on block drawers) or good looking thumnails, but scaled down images as icons.

Solution

Add dedicated iconImageURL field with fallback chain:

Lexical Editor: iconImageURL → imageURL → default BlockIcon
Block Drawer: imageURL → default placeholder (unchanged)

Now you can set different URL for block icons in lexical blocks:
image

Backwards Compatibility

Fully backwards compatible - no breaking changes , new fields are conditional with fallback to previous behaviour

@VeiaG VeiaG requested a review from AlessioGr as a code owner February 14, 2026 14:48
@VeiaG VeiaG changed the title feat(richtext-lexical):add separate fields for icons in lexical blocks feat(richtext-lexical): add separate fields for icons in lexical blocks Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant