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. Presets
  5. Simple Editor

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

Simple Editor

SimpleEditor is a constrained message-editor preset.

It keeps formatting intentionally minimal and supports send workflows out of the box.

Usage

tsx
import { SimpleEditor } from '@lyfie/luthor';
import '@lyfie/luthor/styles.css';

export function App() {
  return (
    <SimpleEditor
      placeholder="Type a message"
      submitOnEnter
      allowShiftEnter
      outputFormat="md"
      onSend={({ text }) => {
        console.log(text);
      }}
    />
  );
}

Props

SimpleEditorProps is purpose-built for message input:

  • formattingOptions: SimpleFormattingOptions (bold, italic, strikethrough)
  • onSend: (payload: SimpleEditorSendPayload) => void
  • outputFormat: 'md' (default) | 'json'
  • clearOnSend: true (default) | false
  • allowEmptySend: false (default) | true
  • submitOnEnter: false (default) | true
  • allowShiftEnter: true (default) | false
  • showSendButton: true (default) | false
  • sendButtonPlacement: 'inside' (default) | 'right'
  • sendButtonContent: ReactNode (default 'Send')
  • sendButtonAriaLabel: string (default 'Send message')
  • sendButtonClassName: string
  • showBottomToolbar: true (default) | false
  • toolbarButtons: readonly SimpleToolbarButton[]
  • toolbarClassName: string
  • toolbarStyle: CSSProperties
  • scrollAreaClassName: string
  • minHeight / maxHeight / minWidth / maxWidth

Behavior

  • Allows only bold, italic, and strikethrough formatting.
  • Always runs visual mode only.
  • Uses custom shortcut defaults for chat-style typing.
  • Supports auto-grow until maxHeight, then internal scrolling.
  • Supports click-to-place-caret in the nearest line of text.

SimpleEditorSendPayload

onSend receives:

  • format: 'md' | 'json'
  • text: output text in the selected outputFormat
  • markdown: markdown representation of current content
  • json: JSON representation of current content

Example: right-side send button

tsx
<SimpleEditor
  sendButtonPlacement="right"
  submitOnEnter
  onSend={({ markdown }) => {
    console.log(markdown);
  }}
/>
Previous: Compose Editor
Next: Legacy Rich Editor