A React markdown editor with a live preview, modelled on HackMD, where Velt Live State keeps the document in sync across users, with presence and text comments.
A HackMD-style markdown editor built with React and Velt. The left pane is a markdown editor and the right pane is a live preview. Velt Live State keeps the markdown in sync between users, VeltPresence shows who is in the document, and VeltComments in text mode lets users comment on selected text. A live demo is at hackmd-velt.vercel.app.
The base UI was generated in Antigravity from a screenshot of HackMD, then Velt was added.
- Split editor and preview: A markdown editor on the left and a live rendered preview on the right, using
react-markdownandremark-gfm. - Live sync:
useLiveState('hackmd-clone-markdown', ...)shares the markdown across all users in real time. - Presence:
VeltPresencein the header shows who is in the document. - Text comments:
VeltCommentsintextModefor comments on selected text. - Demo users: Predefined users to test collaboration in two windows.
- Toolbar and status bar: Editor toolbar, status bar and a default template document.
| Layer | Tool |
|---|---|
| Framework | React, Vite, TypeScript |
| Collaboration | Velt (@veltdev/react: Live State, Presence, Comments) |
| Markdown | react-markdown, remark-gfm |
| Icons | Lucide React |
| UI generation | Google Antigravity |
| Deployment | Vercel |
- Node.js 18 or newer
- A Velt API key from the Velt console
git clone https://github.com/Studio1HQ/hackmd-clone.git
cd hackmd-clone
npm installCreate a .env file in the project root.
| Variable | Description |
|---|---|
VITE_VELT_API_KEY |
Your Velt API key, from the Velt console. |
npm run devVite prints the local URL. Other scripts: npm run build, npm run preview, npm run lint.
App.tsx wraps the app in VeltProvider, identifies the current user and sets the document to collaborative-hackmd-clone-2024. Layout.tsx holds the shared markdown in Velt Live State and passes it to the editor and preview:
const [markdown, setMarkdown] = useLiveState<string>('hackmd-clone-markdown', defaultMarkdown);
// <Editor value={markdown} onChange={setMarkdown} />
// <Preview content={markdown} />src/
├── App.tsx # VeltProvider, identify, setDocument, VeltComments
├── components/
│ ├── Layout.tsx # Live state, two-pane layout
│ ├── Header.tsx # VeltPresence, user switcher
│ ├── Editor.tsx # Markdown input
│ ├── Preview.tsx # Rendered markdown
│ └── StatusBar.tsx
├── constants/defaultTemplate.ts
└── types/veltUser.ts
The UI was produced from a detailed prompt asking for a pixel-exact clone of a HackMD editor screenshot: two panes, dark mode, toolbar and visual-only GitHub and template buttons, with no routing, persistence or API calls.
- Velt documentation: SDK guides and API reference.
- Velt: Product site.
- HackMD: The product this UI imitates.
Built by Studio1, the technical content and DevRel partner for devtool teams. Made with Velt.
Browse more open-source examples at github.com/Studio1HQ.
studio1hq.com · Technical content, docs, video and DevRel for devtools







