Luthor
DocumentationDemoPlaygroundGitHub
Luthor

A headless, extensible rich text editor built on Lexical. Ship faster with production-ready defaults and TypeScript-first APIs.

Documentation

IntroductionInstallation@lyfie/headless@lyfie/luthor

Resources

DemoPlaygroundGitHubnpm Package

Support the Project

Buy me a coffeeStar on GitHub

Built with love by developers for developers.

DocsGitHubllms.txtllms-full.txt
  1. Home
  2. Docs
  3. Luthor Headless
  4. Features
  5. Customization And Theming

Luthor Documentation

Getting Started

  • Introduction
  • Installation
  • @lyfie/headless
  • @lyfie/luthor

@lyfie/headless

  • Features
  • Typography and Text
  • Structure and Lists
  • Media and Embeds
  • Code and Devtools
  • Interaction and Productivity
  • Customization and Theming

@lyfie/luthor

  • Presets
  • Extensive
  • Simple Text
  • Rich Text
  • Chat Window
  • Email Compose
  • Markdown
  • Notion Like
  • Headless Preset
  • Notes

Customization and Theming

This group covers custom block logic and theming APIs.

Included APIs

  • createCustomNodeExtension
  • defaultLuthorTheme
  • mergeThemes
  • createEditorThemeStyleVars

Example: custom extension

tsx
import {
  createEditorSystem,
  RichText,
  richTextExtension,
  createCustomNodeExtension,
} from '@lyfie/luthor-headless';

const calloutExtension = createCustomNodeExtension({
  key: 'callout',
  category: 'block',
  nodeType: 'element',
  createNode: ({ $createParagraphNode, $createTextNode }) => {
    const node = $createParagraphNode();
    node.append($createTextNode('Callout block'));
    return node;
  },
});

const extensions = [richTextExtension, calloutExtension] as const;
const { Provider } = createEditorSystem<typeof extensions>();

export function App() {
  return (
    <Provider extensions={extensions}>
      <RichText placeholder="Custom editor..." />
    </Provider>
  );
}

Example: theme override

ts
import { mergeThemes, defaultLuthorTheme } from '@lyfie/luthor-headless';

const theme = mergeThemes(defaultLuthorTheme, {
  colors: {
    background: '#0b1020',
    foreground: '#f8fafc',
  },
});
Previous: Interaction and Productivity
Next: Presets