OpenPencil provides a complete set of drawing tools for creating UI designs, wireframes, and prototypes. All tools are accessible through keyboard shortcuts and the toolbar.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/open-pencil/open-pencil/llms.txt
Use this file to discover all available pages before exploring further.
Shape Tools
Create basic shapes that form the building blocks of your designs.Frame (F)
Frames are container nodes that can hold other elements. Use frames for layouts, cards, screens, and nested structures.- Clip content: Controls whether children are clipped to frame bounds (default: off)
- Auto-layout: Convert to flexbox layout with
Shift+A - Corner radius: Supports independent corners
Frames clip content off by default in OpenPencil, unlike Figma where it’s on by default.
Rectangle (R)
Solid rectangular shapes with customizable corner radius and fills.- Uniform: Single value for all corners
- Independent: Set
topLeftRadius,topRightRadius,bottomRightRadius,bottomLeftRadius
Ellipse (E)
Circular and oval shapes.Polygon & Star
Create regular polygons and star shapes with configurable point counts.pointCount: Number of points (default: 5)starInnerRadius: Inner radius ratio (0.0 - 1.0, default: 0.38)
Line
Straight line segment with stroke styling.Pen Tool (P)
Create custom vector paths with the pen tool. OpenPencil uses vector networks — Figma’s proprietary vector format that supports branching paths and non-closed regions.Vector Networks
Vector networks consist of:- Vertices: Points with x/y coordinates
- Segments: Bezier curves connecting vertices with tangent handles
- Regions: Filled areas defined by closed loops
strokeCap: ‘NONE’ | ‘ROUND’ | ‘SQUARE’strokeJoin: ‘MITER’ | ‘BEVEL’ | ‘ROUND’cornerRadius: Rounded corners at vertexhandleMirroring: ‘NONE’ | ‘ANGLE’ | ‘ANGLE_AND_LENGTH’
Boolean Operations
Combine vector shapes with boolean operations:Text Tool (T)
Create rich text with system fonts, styles, and layout controls.Basic Text
Text Styling
Font properties:fontFamily: Font name from system fontsfontSize: Point sizefontWeight: 100-900 (Thin to Black)italic: Boolean flagletterSpacing: Additional spacing in pixelslineHeight: Line height (number in pixels or null for auto)
textAlignHorizontal: ‘LEFT’ | ‘CENTER’ | ‘RIGHT’ | ‘JUSTIFIED’textAlignVertical: ‘TOP’ | ‘CENTER’ | ‘BOTTOM’
textCase: ‘ORIGINAL’ | ‘UPPER’ | ‘LOWER’ | ‘TITLE’textDecoration: ‘NONE’ | ‘UNDERLINE’ | ‘STRIKETHROUGH’
Auto-resize
Control how text boxes resize:Style Runs
Apply different styles to text ranges:Auto-Layout (Shift+A)
Convert frames to flexbox layouts with gap, padding, and alignment controls. Uses Yoga WASM for layout computation.Creating Auto-Layout
Layout Properties
Direction:layoutMode: ‘NONE’ | ‘HORIZONTAL’ | ‘VERTICAL’
primaryAxisAlign: ‘MIN’ | ‘CENTER’ | ‘MAX’ | ‘SPACE_BETWEEN’counterAxisAlign: ‘MIN’ | ‘CENTER’ | ‘MAX’ | ‘STRETCH’
primaryAxisSizing: ‘FIXED’ | ‘HUG’ | ‘FILL’counterAxisSizing: ‘FIXED’ | ‘HUG’ | ‘FILL’
itemSpacing: Gap between items (primary axis)counterAxisSpacing: Gap between rows/columns (when wrapped)
paddingTop,paddingRight,paddingBottom,paddingLeft
Child Layout Properties
Control how children behave in auto-layout:Min/Max Constraints
Sections
Organize large canvases with labeled sections.- Section title rendered at top with colored background
- Corner radius:
SECTION_CORNER_RADIUS(5px) - Title height:
SECTION_TITLE_HEIGHT(24px) - Title font size:
SECTION_TITLE_FONT_SIZE(12px)
Groups (Cmd+G)
Group multiple nodes without affecting their positions.- Groups don’t have fills or strokes
- Children positions are relative to group origin
- Creating a group preserves children’s absolute positions
Implementation Details
Scene Graph
All nodes are stored in a flatMap<string, SceneNode> with parent-child relationships tracked via parentId and childIds:
packages/core/src/scene-graph.ts:655-666
Rendering
OpenPencil uses Skia (CanvasKit WASM) for rendering. All shapes are rendered to a WebGL canvas, not DOM elements. Key constants frompackages/core/src/constants.ts:
PEN_HANDLE_RADIUS: 3pxPEN_VERTEX_RADIUS: 4pxDEFAULT_FONT_FAMILY: ‘Inter’DEFAULT_FONT_SIZE: 14SELECTION_COLOR:{ r: 0.23, g: 0.51, b: 0.96, a: 1 }
Layout Engine
Auto-layout uses Yoga WASM for flexbox computation. After modifying layout properties, call:Keyboard Shortcuts
| Shortcut | Tool |
|---|---|
F | Frame |
R | Rectangle |
E | Ellipse |
T | Text |
P | Pen |
L | Line |
Shift+A | Toggle auto-layout |
Cmd+G | Group selection |
Cmd+Shift+G | Ungroup |
See Also
- Components - Reusable design elements
- AI Chat - Create designs with natural language
- File Format - Understanding .fig files