iTranslated by AI
Overview and Usage of Pencil: An AI Design Tool
Introduction
Pencil is an AI-driven design tool that can be used directly within your IDE. You can create UI designs on editors like VS Code or Cursor and convert them directly into React or Tailwind CSS code.
In this article, I will introduce the main features and basic usage of Pencil.
What is Pencil?
Pencil is a tool aimed at integrating design and code. It has the following features:
- Direct design work within the editor
- Version control via
.penfiles - AI-powered prompt-driven design generation
- Instant conversion to code
Main Features
Integration with IDEs
It can be installed as an extension for editors such as VS Code and Cursor. Design files are saved in .pen format and can be managed with Git just like regular source code.
Design Generation via AI
When you enter a prompt in natural language, AI such as Claude Code generates the UI.
Example: "Create a login screen in dark mode"
The generated design can be manually adjusted or refined with additional prompts.
Conversion to Code
Created designs can be converted into code in formats such as React, Tailwind CSS, and Next.js. Bidirectional synchronization between design and code is also possible.
MCP Integration
It supports the Model Context Protocol (MCP), allowing integration with AI agents like Claude Code and Cursor.
Setup Method
Desktop App (Mac/Linux)
- Download the app from the official download page
- Run the installer to install the app
Editor Extensions (Including Windows)
It can be used as an extension for VS Code, Cursor, and Antigravity.
VS Code Example:
- Open the VS Code Extensions panel (
Ctrl+Shift+X) - Search for "Pencil"
- Install the official "Pencil" extension
- The pencil icon will appear in the sidebar
Integration with Claude Code
- Click the connect button in the Pencil app
- Enter the email address you registered with Claude Code on the screen that appears
- Follow the authentication steps to complete pairing
- Run the
/mcpcommand in Claude Code and confirmpencil · ✔ connected
Basic Usage
Creating Design Files
For editor extensions:
- Create a new
.penfile in your project directory - A dedicated canvas will open
For the desktop app:
- Click "New .pen file" in the sidebar
- An infinite canvas will be displayed
Design Generation via AI Prompts
- Enter natural language in the AI chat field or at the top of the canvas
- Click the generate button
- The AI generates the layout and color scheme
- Adjust manually as needed
Exporting Code
- Select the code export function from the top right of the canvas or the menu
- Select the format, such as React, Tailwind, or Next.js
- Incorporate the generated code into your project
File Management
Design files are written in an open JSON-based format, making them suitable for version control with Git. Partial support for importing Figma files is also available.
Summary
Pencil is a tool that combines design-code integration, AI-driven generation, and version control. Since it allows design work directly within the editor, it makes handling design much easier within the development workflow.
Discussion