Penpot UI/UX Design Guide
Create professional, user-centered designs in Penpot using the penpot/penpot-mcp MCP server and proven UI/UX principles.
Available MCP Tools
| Tool |
Purpose |
mcp__penpot__execute_code |
Run JavaScript in Penpot plugin context to create/modify designs |
mcp__penpot__export_shape |
Export shapes as PNG/SVG for visual inspection |
mcp__penpot__import_image |
Import images (icons, photos, logos) into designs |
mcp__penpot__penpot_api_info |
Retrieve Penpot API documentation |
MCP Server Setup
The Penpot MCP tools require the penpot/penpot-mcp server running locally. For detailed installation and troubleshooting, see setup-troubleshooting.md.
Before Setup: Check If Already Running
Always check if the MCP server is already available before attempting setup:
Try calling a tool first: Attempt mcp__penpot__penpot_api_info - if it succeeds, the server is running and connected. No setup needed.
If the tool fails, ask the user:
"The Penpot MCP server doesn't appear to be connected. Is the server already installed and running? If so, I can help troubleshoot. If not, I can guide you through the setup."
Only proceed with setup instructions if the user confirms the server is not installed.
Quick Start (Only If Not Installed)
# Clone and install
git clone https://github.com/penpot/penpot-mcp.git
cd penpot-mcp
npm install
# Build and start servers
npm run bootstrap
Then in Penpot:
- Open a design file
- Go to Plugins → Load plugin from URL
- Enter:
http://localhost:4400/manifest.json
- Click "Connect to MCP server" in the plugin UI
VS Code Configuration
Add to settings.json:
{
"mcp": {
"servers": {
"penpot": {
"url": "http://localhost:4401/sse"
}
}
}
}
Troubleshooting (If Server Is Installed But Not Working)
| Issue |
Solution |
| Plugin won't connect |
Check servers are running (npm run start:all in penpot-mcp dir) |
| Browser blocks localhost |
Allow local network access prompt, or disable Brave Shield, or try Firefox |
| Tools not appearing in client |
Restart VS Code/Claude completely after config changes |
| Tool execution fails/times out |
Ensure Penpot plugin UI is open and shows "Connected" |
| "WebSocket connection failed" |
Check firewall allows ports 4400, 4401, 4402 |
Quick Reference
| Task |
Reference File |
| MCP server installation & troubleshooting |
setup-troubleshooting.md |
| Component specs (buttons, forms, nav) |
component-patterns.md |
| Accessibility (contrast, touch targets) |
accessibility.md |
| Screen sizes & platform specs |
platform-guidelines.md |
Core Design Principles
The Golden Rules
- Clarity over cleverness: Every element must have a purpose
- Consistency builds trust: Reuse patterns, colors, and components
- User goals first: Design for tasks, not features
- Accessibility is not optional: Design for everyone
- Test with real users: Validate assumptions early
Visual Hierarchy (Priority Order)
- Size: Larger = more important
- Color/Contrast: High contrast draws attention
- Position: Top-left (LTR) gets seen first
- Whitespace: Isolation emphasizes importance
- Typography weight: Bold stands out
Design Workflow
- Check for design system first: Ask user if they have existing tokens/specs, or discover from current Penpot file
- Understand the page: Call
mcp__penpot__execute_code with penpotUtils.shapeStructure() to see hierarchy
- Find elements: Use
penpotUtils.findShapes() to locate elements by type or name
- Create/modify: Use
penpot.createBoard(), penpot.createRectangle(), penpot.createText() etc.
- Apply layout: Use
addFlexLayout() for responsive containers
- Validate: Call
mcp__penpot__export_shape to visually check your work
Design System Handling
Before creating designs, determine if the user has an existing design system:
- Ask the user: "Do you have a design system or brand guidelines to follow?"
- Discover from Penpot: Check for existing components, colors, and patterns
// Discover existing design patterns in current file
const allShapes = penpotUtils.findShapes(() => true, penpot.root);
// Find existing colors in use
const colors = new Set();
allShapes.forEach(s => {
if (s.fills) s.fills.forEach(f => colors.add(f.fillColor));
});
// Find existing text styles (font sizes, weights)
const textStyles = allShapes
.filter(s => s.type === 'text')
.map(s => ({ fontSize: s.fontSize, fontWeight: s.fontWeight }));
// Find existing components
const components = penpot.library.local.components;
return { colors: [...colors], textStyles, componentCount: components.length };
If user HAS a design system:
- Use their specified colors, spacing, typography
- Match their existing component patterns
- Follow their naming conventions
If user has NO design system:
- Use the default tokens below as a starting point
- Offer to help establish consistent patterns
- Reference specs in component-patterns.md
Key Penpot API Gotchas
width/height are READ-ONLY → use shape.resize(w, h)
parentX/parentY are READ-ONLY → use penpotUtils.setParentXY(shape, x, y)
- Use
insertChild(index, shape) for z-ordering (not appendChild)
- Flex children array order is REVERSED for
dir="column" or dir="row"
- After
text.resize(), reset growType to "auto-width" or "auto-height"
Positioning New Boards
Always check existing boards before creating new ones to avoid overlap:
// Find all existing boards and calculate next position
const boards = penpotUtils.findShapes(s => s.type === 'board', penpot.root);
let nextX = 0;
const gap = 100; // Space between boards
if (boards.length > 0) {
// Find rightmost board edge
boards.forEach(b => {
const rightEdge = b.x + b.width;
if (rightEdge + gap > nextX) {
nextX = rightEdge + gap;
}
});
}
// Create new board at calculated position
const newBoard = penpot.createBoard();
newBoard.x = nextX;
newBoard.y = 0;
newBoard.resize(375, 812);
Board spacing guidelines:
- Use 100px gap between related screens (same flow)
- Use 200px+ gap between different sections/flows
- Align boards vertically (same y) for visual organization
- Group related screens horizontally in user flow order
Default Design Tokens
Use these defaults only when user has no design system. Always prefer user's tokens if available.
Spacing Scale (8px base)
| Token |
Value |
Usage |
spacing-xs |
4px |
Tight inline elements |
spacing-sm |
8px |
Related elements |
spacing-md |
16px |
Default padding |
spacing-lg |
24px |
Section spacing |
spacing-xl |
32px |
Major sections |
spacing-2xl |
48px |
Page-level spacing |
Typography Scale
| Level |
Size |
Weight |
Usage |
| Display |
48-64px |
Bold |
Hero headlines |
| H1 |
32-40px |
Bold |
Page titles |
| H2 |
24-28px |
Semibold |
Section headers |
| H3 |
20-22px |
Semibold |
Subsections |
| Body |
16px |
Regular |
Main content |
| Small |
14px |
Regular |
Secondary text |
| Caption |
12px |
Regular |
Labels, hints |
Color Usage
| Purpose |
Recommendation |
| Primary |
Main brand color, CTAs |
| Secondary |
Supporting actions |
| Success |
#22C55E range (confirmations) |
| Warning |
#F59E0B range (caution) |
| Error |
#EF4444 range (errors) |
| Neutral |
Gray scale for text/borders |
Common Layouts
Mobile Screen (375×812)
┌─────────────────────────────┐
│ Status Bar (44px) │
├─────────────────────────────┤
│ Header/Nav (56px) │
├─────────────────────────────┤
│ │
│ Content Area │
│ (Scrollable) │
│ Padding: 16px horizontal │
│ │
├─────────────────────────────┤
│ Bottom Nav/CTA (84px) │
└─────────────────────────────┘
Desktop Dashboard (1440×900)
┌──────┬──────────────────────────────────┐
│ │ Header (64px) │
│ Side │──────────────────────────────────│
│ bar │ Page Title + Actions │
│ │──────────────────────────────────│
│ 240 │ Content Grid │
│ px │ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │
│ │ │Card │ │Card │ │Card │ │Card │ │
│ │ └─────┘ └─────┘ └─────┘ └─────┘ │
│ │ │
└──────┴──────────────────────────────────┘
Component Checklist
Buttons
Forms
Navigation
Accessibility Quick Checks
- Color contrast: Text 4.5:1, Large text 3:1
- Touch targets: Minimum 44×44px
- Focus states: Visible keyboard focus indicators
- Alt text: Meaningful descriptions for images
- Hierarchy: Proper heading levels (H1→H2→H3)
- Color independence: Never rely solely on color
Design Review Checklist
Before finalizing any design:
Validating Designs
Use these validation approaches with mcp__penpot__execute_code:
| Check |
Method |
| Elements outside bounds |
penpotUtils.analyzeDescendants() with isContainedIn() |
| Text too small (<12px) |
penpotUtils.findShapes() filtering by fontSize |
| Missing contrast |
Call mcp__penpot__export_shape and visually inspect |
| Hierarchy structure |
penpotUtils.shapeStructure() to review nesting |
Export CSS
Use penpot.generateStyle(selection, { type: 'css', includeChildren: true }) via mcp__penpot__execute_code to extract CSS from designs.
Tips for Great Designs
- Start with content: Real content reveals layout needs
- Design mobile-first: Constraints breed creativity
- Use a grid: 8px base grid keeps things aligned
- Limit colors: 1 primary + 1 secondary + neutrals
- Limit fonts: 1-2 typefaces maximum
- Embrace whitespace: Breathing room improves comprehension
- Be consistent: Same action = same appearance everywhere
- Provide feedback: Every action needs a response
1---2name: penpot-uiux-design3description: 'Comprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or desktop applications, (2) Building design systems with components and tokens, (3) Designing dashboards, forms, navigation, or landing pages, (4) Applying accessibility standards and best practices, (5) Following platform guidelines (iOS, Android, Material Design), (6) Reviewing or improving existing Penpot designs for usability. Triggers: "design a UI", "create interface", "build layout", "design dashboard", "create form", "design landing page", "make it accessible", "design system", "component library".'4metadata:5 source: https://skillmd.com/skills/comeonoliver/penpot-uiux-design6---78# Penpot UI/UX Design Guide910Create professional, user-centered designs in Penpot using the `penpot/penpot-mcp` MCP server and proven UI/UX principles.1112## Available MCP Tools1314| Tool | Purpose |15| ---- | ------- |16| `mcp__penpot__execute_code` | Run JavaScript in Penpot plugin context to create/modify designs |17| `mcp__penpot__export_shape` | Export shapes as PNG/SVG for visual inspection |18| `mcp__penpot__import_image` | Import images (icons, photos, logos) into designs |19| `mcp__penpot__penpot_api_info` | Retrieve Penpot API documentation |2021## MCP Server Setup2223The Penpot MCP tools require the `penpot/penpot-mcp` server running locally. For detailed installation and troubleshooting, see [setup-troubleshooting.md](references/setup-troubleshooting.md).2425### Before Setup: Check If Already Running2627**Always check if the MCP server is already available before attempting setup:**28291. **Try calling a tool first**: Attempt `mcp__penpot__penpot_api_info` - if it succeeds, the server is running and connected. No setup needed.30312. **If the tool fails**, ask the user:32 > "The Penpot MCP server doesn't appear to be connected. Is the server already installed and running? If so, I can help troubleshoot. If not, I can guide you through the setup."33343. **Only proceed with setup instructions if the user confirms the server is not installed.**3536### Quick Start (Only If Not Installed)3738```bash39# Clone and install40git clone https://github.com/penpot/penpot-mcp.git41cd penpot-mcp42npm install4344# Build and start servers45npm run bootstrap46```4748Then in Penpot:491. Open a design file502. Go to **Plugins** → **Load plugin from URL**513. Enter: `http://localhost:4400/manifest.json`524. Click **"Connect to MCP server"** in the plugin UI5354### VS Code Configuration5556Add to `settings.json`:57```json58{59 "mcp": {60 "servers": {61 "penpot": {62 "url": "http://localhost:4401/sse"63 }64 }65 }66}67```6869### Troubleshooting (If Server Is Installed But Not Working)7071| Issue | Solution |72| ----- | -------- |73| Plugin won't connect | Check servers are running (`npm run start:all` in penpot-mcp dir) |74| Browser blocks localhost | Allow local network access prompt, or disable Brave Shield, or try Firefox |75| Tools not appearing in client | Restart VS Code/Claude completely after config changes |76| Tool execution fails/times out | Ensure Penpot plugin UI is open and shows "Connected" |77| "WebSocket connection failed" | Check firewall allows ports 4400, 4401, 4402 |7879## Quick Reference8081| Task | Reference File |82| ---- | -------------- |83| MCP server installation & troubleshooting | [setup-troubleshooting.md](references/setup-troubleshooting.md) |84| Component specs (buttons, forms, nav) | [component-patterns.md](references/component-patterns.md) |85| Accessibility (contrast, touch targets) | [accessibility.md](references/accessibility.md) |86| Screen sizes & platform specs | [platform-guidelines.md](references/platform-guidelines.md) |8788## Core Design Principles8990### The Golden Rules91921. **Clarity over cleverness**: Every element must have a purpose932. **Consistency builds trust**: Reuse patterns, colors, and components943. **User goals first**: Design for tasks, not features954. **Accessibility is not optional**: Design for everyone965. **Test with real users**: Validate assumptions early9798### Visual Hierarchy (Priority Order)991001. **Size**: Larger = more important1012. **Color/Contrast**: High contrast draws attention1023. **Position**: Top-left (LTR) gets seen first1034. **Whitespace**: Isolation emphasizes importance1045. **Typography weight**: Bold stands out105106## Design Workflow1071081. **Check for design system first**: Ask user if they have existing tokens/specs, or discover from current Penpot file1092. **Understand the page**: Call `mcp__penpot__execute_code` with `penpotUtils.shapeStructure()` to see hierarchy1103. **Find elements**: Use `penpotUtils.findShapes()` to locate elements by type or name1114. **Create/modify**: Use `penpot.createBoard()`, `penpot.createRectangle()`, `penpot.createText()` etc.1125. **Apply layout**: Use `addFlexLayout()` for responsive containers1136. **Validate**: Call `mcp__penpot__export_shape` to visually check your work114115## Design System Handling116117**Before creating designs, determine if the user has an existing design system:**1181191. **Ask the user**: "Do you have a design system or brand guidelines to follow?"1202. **Discover from Penpot**: Check for existing components, colors, and patterns121122```javascript123// Discover existing design patterns in current file124const allShapes = penpotUtils.findShapes(() => true, penpot.root);125126// Find existing colors in use127const colors = new Set();128allShapes.forEach(s => {129 if (s.fills) s.fills.forEach(f => colors.add(f.fillColor));130});131132// Find existing text styles (font sizes, weights)133const textStyles = allShapes134 .filter(s => s.type === 'text')135 .map(s => ({ fontSize: s.fontSize, fontWeight: s.fontWeight }));136137// Find existing components138const components = penpot.library.local.components;139140return { colors: [...colors], textStyles, componentCount: components.length };141```142143**If user HAS a design system:**144145- Use their specified colors, spacing, typography146- Match their existing component patterns147- Follow their naming conventions148149**If user has NO design system:**150151- Use the default tokens below as a starting point152- Offer to help establish consistent patterns153- Reference specs in [component-patterns.md](references/component-patterns.md)154155## Key Penpot API Gotchas156157- `width`/`height` are READ-ONLY → use `shape.resize(w, h)`158- `parentX`/`parentY` are READ-ONLY → use `penpotUtils.setParentXY(shape, x, y)`159- Use `insertChild(index, shape)` for z-ordering (not `appendChild`)160- Flex children array order is REVERSED for `dir="column"` or `dir="row"`161- After `text.resize()`, reset `growType` to `"auto-width"` or `"auto-height"`162163## Positioning New Boards164165**Always check existing boards before creating new ones** to avoid overlap:166167```javascript168// Find all existing boards and calculate next position169const boards = penpotUtils.findShapes(s => s.type === 'board', penpot.root);170let nextX = 0;171const gap = 100; // Space between boards172173if (boards.length > 0) {174 // Find rightmost board edge175 boards.forEach(b => {176 const rightEdge = b.x + b.width;177 if (rightEdge + gap > nextX) {178 nextX = rightEdge + gap;179 }180 });181}182183// Create new board at calculated position184const newBoard = penpot.createBoard();185newBoard.x = nextX;186newBoard.y = 0;187newBoard.resize(375, 812);188```189190**Board spacing guidelines:**191192- Use 100px gap between related screens (same flow)193- Use 200px+ gap between different sections/flows194- Align boards vertically (same y) for visual organization195- Group related screens horizontally in user flow order196197## Default Design Tokens198199**Use these defaults only when user has no design system. Always prefer user's tokens if available.**200201### Spacing Scale (8px base)202203| Token | Value | Usage |204| ----- | ----- | ----- |205| `spacing-xs` | 4px | Tight inline elements |206| `spacing-sm` | 8px | Related elements |207| `spacing-md` | 16px | Default padding |208| `spacing-lg` | 24px | Section spacing |209| `spacing-xl` | 32px | Major sections |210| `spacing-2xl` | 48px | Page-level spacing |211212### Typography Scale213214| Level | Size | Weight | Usage |215| ----- | ---- | ------ | ----- |216| Display | 48-64px | Bold | Hero headlines |217| H1 | 32-40px | Bold | Page titles |218| H2 | 24-28px | Semibold | Section headers |219| H3 | 20-22px | Semibold | Subsections |220| Body | 16px | Regular | Main content |221| Small | 14px | Regular | Secondary text |222| Caption | 12px | Regular | Labels, hints |223224### Color Usage225226| Purpose | Recommendation |227| ------- | -------------- |228| Primary | Main brand color, CTAs |229| Secondary | Supporting actions |230| Success | #22C55E range (confirmations) |231| Warning | #F59E0B range (caution) |232| Error | #EF4444 range (errors) |233| Neutral | Gray scale for text/borders |234235## Common Layouts236237### Mobile Screen (375×812)238239```text240┌─────────────────────────────┐241│ Status Bar (44px) │242├─────────────────────────────┤243│ Header/Nav (56px) │244├─────────────────────────────┤245│ │246│ Content Area │247│ (Scrollable) │248│ Padding: 16px horizontal │249│ │250├─────────────────────────────┤251│ Bottom Nav/CTA (84px) │252└─────────────────────────────┘253254```255256### Desktop Dashboard (1440×900)257258```text259┌──────┬──────────────────────────────────┐260│ │ Header (64px) │261│ Side │──────────────────────────────────│262│ bar │ Page Title + Actions │263│ │──────────────────────────────────│264│ 240 │ Content Grid │265│ px │ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │266│ │ │Card │ │Card │ │Card │ │Card │ │267│ │ └─────┘ └─────┘ └─────┘ └─────┘ │268│ │ │269└──────┴──────────────────────────────────┘270271```272273## Component Checklist274275### Buttons276277- [ ] Clear, action-oriented label (2-3 words)278- [ ] Minimum touch target: 44×44px279- [ ] Visual states: default, hover, active, disabled, loading280- [ ] Sufficient contrast (3:1 against background)281- [ ] Consistent border radius across app282283### Forms284285- [ ] Labels above inputs (not just placeholders)286- [ ] Required field indicators287- [ ] Error messages adjacent to fields288- [ ] Logical tab order289- [ ] Input types match content (email, tel, etc.)290291### Navigation292293- [ ] Current location clearly indicated294- [ ] Consistent position across screens295- [ ] Maximum 7±2 top-level items296- [ ] Touch-friendly on mobile (48px targets)297298## Accessibility Quick Checks2993001. **Color contrast**: Text 4.5:1, Large text 3:13012. **Touch targets**: Minimum 44×44px3023. **Focus states**: Visible keyboard focus indicators3034. **Alt text**: Meaningful descriptions for images3045. **Hierarchy**: Proper heading levels (H1→H2→H3)3056. **Color independence**: Never rely solely on color306307## Design Review Checklist308309Before finalizing any design:310311- [ ] Visual hierarchy is clear312- [ ] Consistent spacing and alignment313- [ ] Typography is readable (16px+ body text)314- [ ] Color contrast meets WCAG AA315- [ ] Interactive elements are obvious316- [ ] Mobile-friendly touch targets317- [ ] Loading/empty/error states considered318- [ ] Consistent with design system319320## Validating Designs321322Use these validation approaches with `mcp__penpot__execute_code`:323324| Check | Method |325| ----- | ------ |326| Elements outside bounds | `penpotUtils.analyzeDescendants()` with `isContainedIn()` |327| Text too small (<12px) | `penpotUtils.findShapes()` filtering by `fontSize` |328| Missing contrast | Call `mcp__penpot__export_shape` and visually inspect |329| Hierarchy structure | `penpotUtils.shapeStructure()` to review nesting |330331### Export CSS332333Use `penpot.generateStyle(selection, { type: 'css', includeChildren: true })` via `mcp__penpot__execute_code` to extract CSS from designs.334335## Tips for Great Designs3363371. **Start with content**: Real content reveals layout needs3382. **Design mobile-first**: Constraints breed creativity3393. **Use a grid**: 8px base grid keeps things aligned3404. **Limit colors**: 1 primary + 1 secondary + neutrals3415. **Limit fonts**: 1-2 typefaces maximum3426. **Embrace whitespace**: Breathing room improves comprehension3437. **Be consistent**: Same action = same appearance everywhere3448. **Provide feedback**: Every action needs a response345