DemoDocsPlaygroundGitHub

An extensible rich text editor framework built on Lexical. Ship faster with production-ready defaults and TypeScript-first APIs.

Documentation

IntroductionInstallation@lyfie/luthor-headless@lyfie/luthor

Resources

DemoFeaturesPlaygroundGitHubluthor @ npmluthor-headless @ npm

Support the Project

Buy me a coffeeStar on GitHub

Built with ❤️ by Lyfie.org

HomeDocsFeaturesDemoGitHubllms.txtllms-full.txt
  1. Home
  2. Docs
  3. Luthor
  4. Feature Flags

Luthor Documentation

Getting Started

  • Introduction
  • Installation
  • Contributor Guide
  • AI Agents and Vibe Coding
  • Capabilities
  • @lyfie/luthor-headless
  • @lyfie/luthor

@lyfie/luthor-headless

  • Architecture
  • Extensions and API
  • Metadata Comment System
  • Features
  • Typography and Text
  • Structure and Lists
  • Media and Embeds
  • Code and Devtools
  • Interaction and Productivity
  • Customization and Theming

@lyfie/luthor

  • Architecture
  • Props Reference
  • Feature Flags
  • Presets
  • Extensive Editor
  • Compose Editor
  • Simple Editor
  • Legacy Rich Editor
  • MD Editor
  • HTML Editor
  • Slash Editor
  • Headless Editor

Feature Flags

@lyfie/luthor uses feature flags to control what each preset can do, without forking runtime logic.

Source of truth

Canonical keys are defined in packages/luthor/src/presets/extensive/extensions.tsx as EXTENSIVE_FEATURE_KEYS.

ts
type FeatureFlag =
  | 'bold'
  | 'italic'
  | 'underline'
  | 'strikethrough'
  | 'fontFamily'
  | 'fontSize'
  | 'lineHeight'
  | 'textColor'
  | 'textHighlight'
  | 'subscript'
  | 'superscript'
  | 'link'
  | 'horizontalRule'
  | 'table'
  | 'list'
  | 'history'
  | 'image'
  | 'blockFormat'
  | 'code'
  | 'codeIntelligence'
  | 'codeFormat'
  | 'tabIndent'
  | 'enterKeyBehavior'
  | 'iframeEmbed'
  | 'youTubeEmbed'
  | 'floatingToolbar'
  | 'contextMenu'
  | 'commandPalette'
  | 'slashCommand'
  | 'emoji'
  | 'draggableBlock'
  | 'customNode'
  | 'themeToggle';

Default behavior

ExtensiveEditor starts with all feature flags enabled (DEFAULT_FEATURE_FLAGS).

Disable selectively:

tsx
<ExtensiveEditor
  featureFlags={{
    image: false,
    table: false,
    customNode: false,
    commandPalette: false,
  }}
/>

Preset enforcement

Some presets enforce specific flags to protect preset contracts:

  • LegacyRichEditor: keeps metadata-heavy features off (table, image, embeds, custom nodes, draggable, palette/slash, emoji, theme toggle).
  • SlashEditor: enforces slashCommand: true and commandPalette: false.
  • HeadlessEditorPreset: keeps a lightweight metadata-friendly profile.
  • SimpleEditor: hardcodes a minimal visual-only chat input profile.

Why enforcement exists

Preset contracts must stay stable. If a preset promises markdown/html-native behavior or slash-first behavior, enforced flags prevent accidental drift.

Feature groups

  • Typography:
    • fontFamily, fontSize, lineHeight
  • Inline formatting:
    • bold, italic, underline, strikethrough, subscript, superscript, codeFormat, textColor, textHighlight
  • Document structure:
    • blockFormat, list, horizontalRule, table, tabIndent, enterKeyBehavior
  • Rich content:
    • image, iframeEmbed, youTubeEmbed, customNode
  • Productivity UI:
    • history, commandPalette, slashCommand, floatingToolbar, contextMenu, draggableBlock, themeToggle, emoji
  • Code workflows:
    • code, codeIntelligence

Full flag reference

FlagWhat it controls
bold / italic / underline / strikethroughCore inline formatting toggles
fontFamily / fontSize / lineHeightTypography selectors and commands
textColor / textHighlightText color + highlight tools
subscript / superscriptScript formatting
linkLink insertion/edit/remove features
horizontalRuleDivider insertion
tableTable insertion/editing controls
listOrdered/unordered/checklist features
historyUndo/redo support
imageImage insertion and image controls
blockFormatParagraph/headings/quote/alignment
codeCode block features
codeIntelligenceCode language detect/select/copy tools
codeFormatInline code format command
tabIndentTab/shift-tab list indentation control
enterKeyBehaviorHard-break and enter behavior features
iframeEmbediframe embedding tools
youTubeEmbedYouTube embedding tools
floatingToolbarFloating contextual toolbar
contextMenuContext menu workflows
commandPaletteCommand palette overlay
slashCommandSlash command menu
emojiEmoji insertion/suggestions
draggableBlockDrag handles and block moving
customNodeCustom node insertion support
themeToggleBuilt-in theme toggle control

Contributor rules

  • Add new flags only in EXTENSIVE_FEATURE_KEYS.
  • Reflect the flag in DEFAULT_FEATURE_FLAGS.
  • Wire the flag into extension assembly in buildExtensiveExtensions(...).
  • Update preset-specific policies if needed.
  • Update docs that describe preset behavior.
Previous: Props Reference
Next: Presets