A Figma widget for editing and displaying code with syntax highlighting.
- 🎨 Syntax Highlighting: Supports multiple programming languages with color-coded syntax (JavaScript, TypeScript, Python, HTML, CSS, JSON, REST, SQL, Markdown, XML)
- 🌓 Theme Support: Toggle between light and dark themes
- ✏️ Full-Featured Code Editor: Click to open a CodeMirror-based editor with line numbers, bracket matching, and auto-completion
- 💾 Real-time Sync: Changes in the editor sync back to the widget instantly with debouncing for performance
- 🎯 Smart Width Adjustment: Widget automatically adjusts width based on code content
- ⚡ Performance Optimized: Debounced updates and efficient rendering
- Clone this repository
- Install dependencies:
npm install
- Build the widget:
npm run build
- In Figma, go to Plugins → Development → Import plugin from manifest
- Select the
manifest.jsonfile from this project
# Build everything
npm run build
# Build widget only
npm run build:widget
# Build UI only
npm run build:ui
# Type check without building
npm run tsc
# Lint code
npm run lint
# Fix lint issues
npm run lint:fix
# Watch for changes (auto-rebuild)
npm run watch- Add the Code Editor Pro widget to your Figma canvas
- Click a code block to open the editor
- Write or paste code and choose language
- Close editor to sync changes automatically
- Figma Widget API
- TypeScript
- esbuild
- CodeMirror 5
MIT License © Asif Ali
Created with ❤️ for Figma by Asif
Contributions are welcome! Please feel free to submit a Pull Request.
