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. Structure And Lists

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

Structure and Lists

This group covers links, headings, paragraphs, lists, and table workflows.

Included extensions

  • linkExtension
  • blockFormatExtension
  • listExtension
  • tableExtension
  • horizontalRuleExtension
  • tabIndentExtension

Example

tsx
import {
  createEditorSystem,
  RichText,
  richTextExtension,
  linkExtension,
  blockFormatExtension,
  listExtension,
  tableExtension,
  horizontalRuleExtension,
  tabIndentExtension,
} from '@lyfie/luthor-headless';

const extensions = [
  richTextExtension,
  linkExtension,
  blockFormatExtension,
  listExtension,
  tableExtension,
  horizontalRuleExtension,
  tabIndentExtension,
] as const;

const { Provider, useEditor } = createEditorSystem<typeof extensions>();

function Toolbar() {
  const { commands } = useEditor();
  return (
    <div>
      <button onClick={() => commands.toggleUnorderedList?.()}>Bullets</button>
      <button onClick={() => commands.toggleOrderedList?.()}>Numbers</button>
      <button onClick={() => commands.insertLink?.('https://example.com')}>Link</button>
      <button onClick={() => commands.insertTable?.({ rows: 3, columns: 3 })}>3x3 Table</button>
    </div>
  );
}

export function App() {
  return (
    <Provider extensions={extensions}>
      <Toolbar />
      <RichText placeholder="Structure your document..." />
    </Provider>
  );
}
Previous: Typography and Text
Next: Media and Embeds