Skip to content

madPO/qwik-editor

Repository files navigation

Qwik Editor ⚡️

A high-performance, WYSIWYG markdown editor built with Qwik.

Features

  • Block-based editing: Content organized as sequential blocks (paragraphs, headings).
  • Inline Formatting: Support for Bold, Italic, and Links with a floating toolbar.
  • Keyboard Shortcuts: Common shortcuts like Ctrl+B (Bold) and Ctrl+I (Italic).
  • Markdown-first: Bidirectional conversion between editor state and CommonMark.
  • High performance: Fine-grained reactivity ensures fast keystroke response even with many blocks.
  • SSR-friendly: Built for Qwik's resumability and server-side rendering.

Usage

import { component$, useSignal } from "@builder.io/qwik";
import { Editor } from "qwik-editor";

export default component$(() => {
  const markdown = useSignal("# Hello Editor\n\nStart typing here...");

  return (
    <Editor
      initialMarkdown={markdown.value}
      onChange$={(md) => {
        markdown.value = md;
      }}
      placeholder="Write something..."
    />
  );
});

Tech Stack

  • Framework: Qwik
  • Language: TypeScript (Strict Mode)
  • Tooling:
    • Oxlint: Rust-based high-performance linting.
    • Oxfmt: Rust-based high-performance formatting.
    • Vite: Build tool and development server.

Project Structure

├── src/
│   ├── components/  # Editor and block components
│   ├── models/      # Data structures (EditorDocument, Block)
│   ├── services/    # Markdown parsing and serialization
│   └── index.ts     # Library entry point

Development

Setup

pnpm install

Development Mode

Runs Vite's development server with SSR enabled.

pnpm dev

Production Build

Generates the library in ./lib and TypeScript definitions in ./lib-types.

pnpm build

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors