Docs / Guides
Proto Studio (Labs preview)
Design application interfaces and prototypes on a canvas that is real HTML and CSS. The design reasons are in ADR 0034; the full plan, the document model and the build tasks are in the concept. This page is the user guide and grows with every task of the plan.
Preview. Proto is being built in steps during the 1.3.x releases. Until the preview ends it is reachable only with Settings ▸ Labs ▸ Proto Studio. What is there today: the canvas, the drawing tools, auto layout and grid, the Pages, Layers, Assets, Design and Variables panels, components and instances, variables with modes and brands, styles, design tokens, comments, undo, saving, editing together in a collaboration room and the assistant's tools. Prototyping and code export follow.
Turning it on#
Open Settings ▸ Labs and turn on Proto Studio. The studio appears at once in the studio switcher (in the More menu when the header already shows five studios), in File ▸ New (Proto opens a choice of starters and templates) and in File ▸ New Blank (Blank Proto Design, an empty page). Turning the switch off takes effect at the next start; designs you made stay ordinary files. Opening a design while the switch is off offers to turn it on.
Templates#
The start screen and File ▸ New offer three starters (a desktop frame, a phone frame, an empty page) and five templates, complete designs to take apart or build on:
| Template | What is in it |
|---|---|
| Marketing website | Home, Pricing (plans, comparison table, questions), Blog and an Article, with a shared header and footer |
| Mobile app | Onboarding (welcome, plant picker, account), Home, Plant detail and Settings, the last three also in dark mode |
| SaaS dashboard | Overview (metric cards, line, donut and bar charts, activity, a table), Customers, Customer detail, Settings |
| Design system starter | Documentation pages for color (light and dark), typography, spacing and radius, elevation, buttons, form controls and cards |
| Portfolio | Home with a work grid, a case study and an about page |
Every template starts from a design system: color variables with Light and Dark modes, spacing and radius
variables, text and effect styles, and components with variants (Button, Input, Badge, Checkbox, Switch, Tab, Nav item,
Avatar, Card, List item, Stat and the template's own) on a Components page. Screens use auto layout throughout, bind
their colors and spacing to the variables, use instances with their properties, and are connected as prototype flows
(Prototype ▸ Preview). The copy is realistic and made up for fictional products. From the terminal,
ofini new proto site.ofini --template marketing builds the same design (CLI).
Designs and files#
A design is an ordinary .ofini document (kind proto, see file format). Save,
Save As, autosave, session restore and the History panel work as for every other document; every change is one undo
step. A design saved by a newer version of OpenFini, or one with problems, opens read-only with a notice (Help ▸
Doctor lists the problems).
Tools#
The toolbar at the bottom of the canvas holds the tools; each has a single-key shortcut (they are also in the Insert and View menus). After drawing a layer the Move tool comes back.
| Tool | Key | How |
|---|---|---|
| Move | V | Select, move, resize and rotate (below) |
| Frame | F | Drag a frame, or click for 100 × 100. The arrow next to it (and Insert ▸ … Frame) adds a device frame: desktop, laptop, tablet, phone, Android phone, watch |
| Rectangle, Ellipse | R, O | Drag; Shift draws a square or circle, Alt draws from the center; a click places 100 × 100 |
| Line | L | Drag from one end to the other; Shift keeps 45° steps |
| Pen | P | Click for corners, drag for curves, click the first point to close; Enter or Escape ends an open path, Backspace removes the last point |
| Text | T | Click for a text that grows with what you type, drag for a fixed width that wraps. Type, then Escape or click elsewhere |
| Image | Shift+Ctrl/Cmd+K | Click where the picture goes and choose one or more images (PNG, JPEG, GIF, WebP, AVIF); they are placed at their pixel size. Insert ▸ Image… does the same in the middle of the view |
| Hand | H | Drag to pan (Space and the middle mouse button pan with every tool) |
| Zoom | Z | Click to zoom in, Alt-click to zoom out, drag a rectangle to zoom to it |
| Comment | C | Click a layer or the page to write a comment there (Comments) |
A new layer goes into the frame under the pointer; in a frame with auto layout it lands in the flow at the pointer.
Importing#
File ▸ Import into Proto… (also at the end of the Insert menu), dropping files on the canvas and pasting bring other designs in as editable layers. One import is one undo step; when something could not be kept editable, a notice offers Details (the import report: what was kept, flattened and left out; File ▸ Import Report… shows it again).
| Source | What you get |
|---|---|
HTML and CSS (.html, pasted HTML, proto_write_html) | The page is rendered in a hidden sandboxed frame at the width of the target frame (1280 px on the page) and read back: flex and grid become auto layout with gaps, padding and alignment; widths and heights become fixed, hug or fill where the CSS says so; other blocks become column auto layouts whose gap is the space between their children; positioned elements become absolute layers; text keeps one run per style; backgrounds, gradients, borders, radii, shadows, blur, opacity and rotation map to the Design panel's fields; :root custom properties become a variable collection; inline SVG becomes vector layers; embedded (data:) images become image layers. Scripts never run and nothing is downloaded: remote images become gray placeholders |
SVG (.svg, pasted SVG) | A frame of the SVG's size; groups become frames without layout; rectangles and ellipses stay rectangles and ellipses; paths, polygons and rotated shapes become vector layers; gradients, strokes, text and embedded images are kept. Filters, masks and clip paths are listed in the report |
Sketch (.sketch) | Every page becomes a page; artboards become frames; symbols become components and symbol instances become instances with their text, image and nested symbol overrides; stacks become auto layout; text keeps its styled runs; shadows and blurs become effects |
Penpot (.penpot, the export of Penpot 2) | Pages, boards with flex and grid layout, shapes, paths, text runs, images, shadows; components become components and their copies instances with text, fill and visibility overrides. The file's design tokens are listed in the report: import its tokens.json with DTCG |
| Images | Image layers at their pixel size |
Figma (.fig), Labs, read only, best effort | Turn on Settings ▸ Labs ▸ Figma File Import first. Pages, frames and sections, auto layout (direction, gap, padding, alignment, wrap, hug, fill and absolute children), groups, rectangles, ellipses, lines, vectors, stars, polygons and boolean results (from the geometry the file stores), text with styled runs, solid, gradient and image fills, strokes (dashes, per-side widths), corner radii, shadows and blurs, blend modes, constraints; components, component sets with variants, text, boolean and instance swap properties, instances with variant values, property values and overrides; variable collections with modes and aliases, and fills bound to color variables. Not imported (listed in the report): prototypes, layout grids, styles as styles (their values are kept), masks, mirroring, FigJam objects, components from libraries (their instances become frames). The format has no public specification, so check the result; OpenFini can never save .fig files. Other routes: copy frames as SVG in Figma and paste them, or export SVG |
Where layers go: into the selected frame (into its flow when it has auto layout), else into the frame you drop on, else on the page in the middle of the view. Sketch and Penpot pages become new pages of the design.
Copy and paste with other apps. Copying Proto layers also puts them on the system clipboard (as an OpenFini format and as HTML carrying it, with the images they use), so they paste into another OpenFini window or tab with their fills, text, components and media. Pasting reads the system clipboard: Proto layers, SVG (many design tools copy SVG), HTML, images and plain text (a text layer). When the browser blocks clipboard access for Edit ▸ Paste, Ctrl+V on the canvas still works.
Limits: HTML 8 MiB, SVG 16 MiB, archives 256 MiB that unpack to at most 512 MiB (and not more than 200 times their
size), 50,000 layers per import, 16 MiB per image. From the terminal, ofini proto import uses the same importers
(CLI); HTML is then laid out without a browser and is approximate.
Plugins#
The Plugins menu runs Figma plugins on the open design: install one from its folder (with manifest.json) or a
ZIP file, then run its commands from Plugins ▸ Plugins… or Run Last Plugin. Plugins run in a sandbox, reach the
network only for the domains their manifest lists and you allow, and every batch of changes is one undo step. Which
parts of Figma's plugin API work is listed in figma-plugins.md.
Selecting and editing on the canvas#
| Action | How |
|---|---|
| Select a layer | Click it. A click inside a frame selects the frame's layer under the pointer; with a layer selected, clicks select among its siblings |
| Select the deepest layer | Ctrl-click (Cmd-click on macOS) |
| Go into a frame, edit a text | Double-click (Enter also edits a selected text) |
| Add to or remove from the selection | Shift-click |
| Marquee | Drag on the empty canvas (top-level layers) or on the background of a frame that is not selected (its layers); Shift keeps the selection |
| Move | Drag. Layers snap to the edges and centers of their siblings and parent (pink guides) and show the distances to their neighbors; Shift keeps one axis, Ctrl/Cmd turns snapping off, Alt duplicates. Dropping on another frame moves the layer into it at the same place. A frame can also be dragged by its name |
| Reorder in auto layout | Drag a layer inside its auto layout frame: a line shows where it lands. Drag it out of the frame to take it out |
| Resize | The handles at the corners and edges. Shift keeps the ratio, Alt resizes around the center. Layers inside a frame without auto layout follow their constraints |
| Rotate | Drag just outside a corner; Shift keeps 15° steps |
| Padding and gap | Select an auto layout frame and drag the pink handles in its padding or between its children; Alt changes all sides, Shift the opposite side too |
| Measure | Hold Alt over another layer to see the distances from the selection |
| Nudge | Arrow keys move by 1 pixel (Shift: 10); in auto layout they move the layer one place |
| Next layer | Tab, Shift+Tab |
| Children / parent | Enter selects the children of the selection, Shift+Enter or Escape its parent |
| Select all | Ctrl+A: the siblings of the selection, or every frame of the page |
| Pan and zoom | Scroll (Shift+scroll: sideways), Space-drag, middle mouse button; Ctrl+scroll or pinch zooms; + and − step; Shift+0 is 100 %, Shift+1 fits everything, Shift+2 fits the selection |
| Copy, cut, paste, duplicate, delete | Ctrl+C, Ctrl+X, Ctrl+V (into the selected frame, next to the selection, or to the right of the page's frames), Ctrl+D, Delete |
The Object menu and the canvas context menu (right-click) have the layout and arrangement commands:
| Command | Shortcut |
|---|---|
| Add Auto Layout: a selected frame without layout arranges its children (direction, gap and padding guessed from where they are); other selections are wrapped in a new auto layout frame | Shift+A |
| Add Grid Layout | Ctrl+Alt+G |
| Remove Auto Layout (the children keep their places) | Alt+Shift+A |
| Group Selection (a frame without layout around the selection), Ungroup | Ctrl+G, Ctrl+Shift+G |
| Bring to Front, Bring Forward, Send Backward, Send to Back | Ctrl+Shift+], Ctrl+], Ctrl+[, Ctrl+Shift+[ |
| Show/Hide, Lock/Unlock (locked layers cannot be selected on the canvas) | Ctrl+Shift+H, Ctrl+Shift+L |
| Rename | F2 |
Every action is one undo step (Ctrl+Z, Ctrl+Shift+Z). Frame names are drawn above the frames. Far zoomed out, small frames are drawn as simplified boxes until you zoom in again; that keeps very large pages smooth.
Rulers, guides and layout grids#
- Rulers (View ▸ Rulers, Shift+R) run along the top and left of the canvas. They count canvas pixels from the top-left corner of the selection's top-level frame (from the page origin when nothing is selected) and highlight where the selection starts and ends.
- Guides: drag out of the top ruler for a horizontal guide, out of the left ruler for a vertical one. Dropped on a top-level frame, the guide belongs to that frame (it moves with it and is counted from its corner); elsewhere it belongs to the page. With the Move tool, drag a guide to move it (Shift: 8 px steps) and drop it on a ruler to remove it. View ▸ Clear Guides removes the guides of the selected frames, or of the whole page.
- Layout grids: the Layout grid section of the Design panel (frames and components) adds columns, rows or a square grid. Columns and rows have a count, a gutter and a margin; Stretch fills the frame, Start, Center and End place tracks of a fixed width. Each grid has a color and can be hidden with its eye button. Object ▸ Add Layout Grid adds 12 columns to desktop frames, 8 to tablets and 4 to phones.
- Snapping: moving, resizing and drawing snap to guides and to the edges of layout grid columns and rows (and the lines of square grids), like they snap to other layers; Ctrl/Cmd turns snapping off.
- View ▸ Guides and View ▸ Layout Grids (Ctrl+Shift+4) show and hide them; whether rulers, guides and grids show is remembered per design view and not saved in the file. Guides and grids themselves are part of the design: adding, moving or removing one is one undo step and collaborators see it. They have no meaning in CSS and are never exported.
The Alt-hover measurements between layers (above) work with rulers on or off.
Panels#
The panels dock like everywhere else (workspaces).
- Pages (left): the pages of the design. Click to show a page, double-click or F2 to rename, Alt+Up/Down to move, the trash button or Delete to delete (the last page stays), + to add. The prototype flows of the page are listed below: the play button plays a flow, a click shows its first frame, double-click renames, + adds a flow at the selected frame (or the page's first frame).
- Layers (left): the layers of the page, top of the list = in front. Click selects, Shift-click selects a range, Ctrl-click adds; double-click a name (or F2, Enter) to rename; the eye and lock buttons hide and lock; drag rows to reorder or to move layers into another frame (the middle of a frame's row drops inside); the search field filters by name. Arrow keys move through the list, Left and Right close and open, Delete deletes. Only the rows in view are built, so pages with many thousands of layers stay fast.
- Design (right): the properties of the selection; a change applies to every selected layer. Position (X, Y,
rotation, align buttons, constraints for layers in frames without auto layout, Ignore auto layout and grid cells
for children of an auto layout); Size (fixed, hug contents, fill container, relative, minimum and maximum);
Auto layout (none, auto layout or grid; direction, wrap, gaps, padding, a 3 × 3 alignment matrix, justify and
align; grid columns and rows written like
1fr 240px auto minmax(200px, 1fr); clip content); Appearance (opacity, blend mode, corner radius, also per corner); Fill, Stroke and Effects lists (solid and gradient fills, inside, center and outside strokes, drop and inner shadows, layer and background blur); Text (font, size, weight, line height, letter spacing, alignment, case, decoration, color, auto width / auto height / fixed size, maximum lines); Accessibility and code (HTML element, role, accessible name); Export (a code format, Export code… saves a ZIP of the selection or the page, Show code opens the Code panel). Drag a field's label to scrub a value. With nothing selected the panel shows the page's name and background. Components, instances, variable bindings, styles and modes add their sections (below). The Prototype tab next to Design switches to Prototype mode (Prototypes). - Assets (left, a tab next to Layers): the components and component sets of the design with previews, and the styles; search by name. Drag a component onto the canvas to insert an instance.
- Variables (bottom): the variables of a collection as a table (below).
- Code (right, a tab next to Design; dockable anywhere): the code of the selection, or of the page when nothing is selected, in the chosen format, updated as you edit. Pick a file of the export, copy it, or download every file as a ZIP. Notes below the code list what the format cannot express.
Components and instances#
A component is a reusable layer: every instance of it shows the component and follows its changes.
- Create one from the selection with the grid button next to the layer name in the Design panel, Object ▸ Create Component (Ctrl+Alt+K) or Create component in the Assets panel. A frame becomes the component; other selections are wrapped in one.
- Variants: select several components and choose Combine as variants. Names such as
size=md, state=hoverbecome variant properties (size and state); other names become one property variant. The Design panel of a component set lists its variants (click to select one) and Add variant copies the selected one. - Properties (Design panel of a component or set, the + button): text, boolean, number, instance swap, slot and,
for sets, variant properties. Rename them in place, set defaults (variant options are written
sm, md, lg), and delete them. To connect a property, select the layer inside the component: the Component property section binds its text content, its visibility, a nested instance (swap) or a slot. - Insert an instance by dragging a component from the Assets panel onto the canvas (it lands in the frame under the pointer, in its auto layout at the pointer), by double-clicking it or pressing Enter on it (into the selected frame, or the middle of the view). Right-click an asset to go to the main component or to swap the selected instances.
- Instances have an Instance section in the Design panel: the main component with Go to main component, Swap, a picker per variant property, a field per property, how many overrides and property values the instance has (and how many no longer apply because the main component changed), Reset overrides, Reset all (also the property values) and Detach (Ctrl+Alt+B; the instance becomes ordinary layers). The same commands are in the Object and context menus.
Variables, modes and styles#
Variables are named colors, numbers, texts and booleans grouped in collections with modes (Light and Dark, Compact and Comfortable). Open the Variables panel (bottom; Window ▸ Variables):
- The collection menu at the top switches collections; + creates one (with Light and Dark modes); the … menu creates a brand (a collection that extends the current one and overrides some of its values), renames, adds modes and deletes. Mode names are edited in the column headers; their menu makes a mode the default or deletes it.
- The table has a row per variable and a column per mode. Type values in the cells (colors also with the swatch); the hexagon button of a cell makes it an alias of another variable (shown as a chip; Detach alias writes the value back). In a brand, values you change override the base for that brand only (marked with a bar; Reset to the base value removes the override); unchanged values are shown in italics.
- The row menu sets scopes (where a variable can be used: fills, strokes, text color, gap, padding, corner radius…), the code name (the CSS custom property of code export) and deletes the variable (layers keep its value).
- Design tokens: the … menu imports a DTCG JSON file (W3C Design Tokens Community Group format, with modes and
aliases; a notice tells what was created, updated and skipped) and exports the variables and styles as DTCG JSON, CSS
custom properties, Tailwind CSS v4
@themeor Swift.
Binding. Fields in the Design panel that can take a variable (opacity, corner radius, gap, padding, fill, stroke and shadow colors, stroke width, font, font size, weight, letter spacing, text color, visibility) have a small hexagon button. It opens a picker with the variables of the right type (those whose scopes exclude the field are disabled); a bound field shows the variable's name, and the scissors button detaches it (the field keeps the current value).
Modes per frame. Frames, components and instances have a Variable modes section (the page has one too when nothing is selected): choose the mode of each collection (and the brand) for that frame and everything in it, or Auto to inherit it. Only the frames that use the variables repaint.
Styles are named fills, text styles, effects and grids. The palette button in the Fill, Stroke, Effects, Text and grid sections applies a style, creates one from the selected layer, updates it from the selection, renames it or detaches it (the values stay on the layer). While a style is applied, the section shows the style instead of the local values. The Assets panel lists the styles: click one to apply it to the selection; right-click to rename, update or delete it.
Prototypes#
A prototype is the design made clickable: layers react to the pointer, keys and time, screens follow each other with animated transitions, and the result plays like the finished app.
Prototype mode. Click Prototype at the top of the Design panel (or Prototype ▸ Prototype Mode, Shift+E switches). The canvas shows every connection as an arrow from a layer to the frame it opens (dashed for overlays and scrolling), Back and Close marks, and a ▶ badge above each flow's first frame. The selected layer gets a round handle at its right edge: drag it onto a frame to make a click there navigate to that frame (one undo step); drag an existing connection's handle onto empty canvas to remove it. Selecting, moving and resizing work as in Design mode.
Interactions (the Prototype panel, for one selected layer). Each interaction has a trigger and a list of actions:
| Triggers | Actions |
|---|---|
| On click, On double click, While pressing, While hovering, Mouse enter, Mouse leave, On drag, Key (with Shift, Alt, Ctrl, Cmd/Win), After delay, Variable changes | Navigate to, Back, Scroll to, Open overlay (position, dimmed background, close when clicking outside), Swap overlay, Close overlay, Change to variant, Set variable, Conditional (if, then, else), Open link |
While hovering and While pressing last as long as the pointer: the variants, variables and overlays they changed
come back when it leaves or is released. Change to variant switches the instance the layer belongs to (or a chosen
instance); put the interaction on a variant of a component set (for example state=default → state=hover) and
every instance reacts. Set variable takes a value (true, 3, text) or an expression such as { "op": "not", "args": [{ "var": "v1" }] }; Toggle flips a boolean. Layers bound to variables (visibility, text, colors) update
as the prototype changes them. Open link opens http(s), mailto and tel links after the usual confirmation.
Transitions (navigate, back, overlays, variants): Instant, Dissolve, Move in, Move out, Push, Slide (with a direction) and Smart animate, with an easing (linear, ease, ease in, ease out, ease in and out, or a spring that takes as long as it needs to settle) and a duration. Smart animate matches the layers of the two screens: the same layer, the only instances of one component, then layers with the same name path (give corresponding layers the same names), then the layers inside matched instances; they move, resize and change color, opacity and corner radius from the old screen to the new one. Layers only one screen has fade.
Scrolling (Prototype panel). Overflow scrolling lets a frame scroll content that does not fit (vertical, horizontal or both); When scrolling makes a layer in auto layout stick to the top, bottom, left or right edge of its scrolling frame (a fixed header or tab bar).
Flows are named starting points. Add one in the Pages panel, with Add flow starting point in the Prototype panel of a top-level frame, or Prototype ▸ Add Flow Starting Point.
Playing. Prototype ▸ Preview Prototype (Ctrl+Alt+Enter, Cmd+Option+Return on a Mac) plays the selection's frame, else the page's first flow; Preview in New Window opens the player in a window of its own (a separate window on the desktop, a pop-up window in the browser), which keeps reading the design as you edit. The player has a flow picker, Back, Restart (R), the device frame (phone, tablet, watch or desktop by the frame's size) and hotspot hints: a click that hits nothing flashes the layers that react. Keys: R restarts, ← and → go to the previous and next flow, Backspace goes back, Esc closes the player in the app. Edits made while the player is open show from the next screen or after a restart.
Export as an HTML prototype#
Prototype ▸ Export Prototype as HTML… saves the prototype as one self-contained HTML file that anyone can open
in a browser, offline, without OpenFini. It plays the design the way the preview does, because it is the same player:
every frame of the design, every trigger (click, double click, while pressing, while hovering, mouse enter and leave,
drag, keys, after delay, variable change), every action (navigate, back, scroll to, open, swap and close overlays,
change variants, set variables with expressions, conditions, open links) and every transition, smart animate
included. The file starts with the current page's first flow (else the first frame of the page); its toolbar has a
flow picker with every flow of the design, Back and Restart, and the keys R, Backspace, ← and →. The address names the
frame on screen (#frame=<id>), so a link can open a given screen.
What is in the file and what is not:
- The design travels as data that the player draws with DOM calls; nothing from the design is read as HTML or script, so layer names and texts cannot run code. A Content-Security-Policy in the file allows only the player's own script, so the page loads nothing from a network and runs nothing else.
- Images are embedded (PNG, JPEG, GIF, WebP, AVIF and SVG); fonts are not: the viewer's installed fonts, else the fallbacks, show. Open link actions open http(s), mailto and tel links in a new tab.
- The device frame and hotspot hints of the in-app preview are left out; a click that hits nothing still flashes the layers that react. Media actions (reserved for video fills) do nothing yet.
The export reports interactions that point to missing layers. From the terminal:
ofini proto export app.ofini --format prototype-html [--flow <name>] [--node <frame>] [--page <page>] [-o demo.html]
(CLI); the assistant and coding agents (MCP) use proto_to_code / proto_generate_code with
format prototype-html.
Presenting in a live room#
When the design is shared in a collaboration room (Editing together), your preview is part of your presence: members who Follow you in the Collaboration window see the player open at the same frame, with the same overlays, and move along with you as you click through the prototype; when you close the preview, theirs closes too. Their toolbar shows Following the presenter. They can still click around on their own; your next screen brings them back. A member who closes the followed preview (Esc) does not see yours again until you start a new one, and a preview they opened themselves is never taken over. Variables and component states are not mirrored, only the frame and the overlays.
Comments#
Comments on a design are the app's comments (saved in the file, shared with a room, listed in the Comments panel). Use the Comment tool (C) and click a layer or an empty spot, or Studio ▸ Add Comment for the selected layer. A numbered pin marks the place; it follows its layer when the layer moves or resizes, and stays where it was when the layer is deleted. Click a pin to read and answer the thread; drag it to another place (your own comments, or as the host). Show where in the Comments panel selects the layer and shows it.
Code export#
Layers become code in five formats: HTML + CSS, React with CSS Modules, React with Tailwind, HTML +
Tailwind (v4) and SwiftUI. Export from the Code panel, the Design panel's Export section, the assistant
(proto_to_code) or the terminal (ofini proto export, CLI).
- The same CSS as the canvas. Each element gets exactly the declarations the canvas renders (hug and fill are
intrinsic sizes and flex, never fixed pixels; absolute positions only for absolute layers), so an exported page looks
like the design: checked in Chromium against the recorded geometry of the layout fixtures
(
node scripts/proto-export-roundtrip.mjs). - Semantic elements and accessibility. A layer's HTML element wins; otherwise text becomes
h1,h2,h3orp(from its text style or size), a layer with a click interaction abutton(or a linkawhen it navigates to another exported screen or opens a web address), an image animgwith its alternative text, a vector an inlinesvg, and frames named like Button, Nav, Header, Footer, Form or Card the matching element. Accessible names and roles becomearia-labelandrole. Inside buttons, links, headings and paragraphs everything is aspan. - Readable names. Classes come from layer names (
pay-button); layers with the same name and the same styles share one class. Frames that only wrap one layer and draw nothing are left out. - Components. In React and SwiftUI every main component (or component set) becomes one component: variant axes are
typed props (
size?: "sm" | "lg"), text, number and boolean properties are props, instance swap and slot properties areReactNodeprops (a single slot ischildren), andclassNameplaces an instance. Variants with the same layers differ only in styles; variants with different layers render one branch each. Instances with overrides inside them are written out as their layers. A component with a code link (code.react.path) is imported from your code instead. HTML has no components: instances are written out. - Variables become CSS custom properties (
var(--color-brand, #4f46e5)) with[data-mode-…]rules for their modes, Tailwind v4@themetokens, or SwiftColorandCGFloatconstants (light and dark values for collections with those modes). Images are files inassets/(public/assets/for React,Assets/for SwiftUI). - Breakpoints. Top-level frames with the same name on one page whose layers match are one responsive screen: the
widest is the base and the narrower ones become
@media (max-width: …)differences with the design's breakpoints (Tailwind:max-[478px]:classes). SwiftUI exports the base frame only. - SwiftUI is best effort: stacks, grids, padding, frames, backgrounds, strokes, radius, shadows, opacity and text map; blend modes, blur, conic gradients, inner shadows, wrapping and grid placement are listed as comments.
- Deterministic: the same design and options always give the same bytes.
Code studio link#
A design can be linked to a Code studio project (another open document with a website). The two then share design tokens, and the layers you link are written into the project as code that follows the design.
- Link: Link to Code Project… (command palette, or the Code project section at the top of the Code panel).
Choose the project (or a new website), the tokens file (default
tokens/tokens.json; empty for none), whether atokens.csswith the CSS variables is written next to it, the folder for generated code (defaultproto), the format (HTML + CSS, React, Tailwind or SwiftUI), the layers (the selection, or every top-level frame and component), what happens when a token differs on both sides, and Live link. Linking is one undo step. - Tokens both ways. The tokens file is a W3C DTCG file. Editing variables or styles in Proto rewrites the file and
tokens.cssabout 0.3 s later (one undo step of that file in the Code studio); editing the file in the Code studio updates the variables (one undo step of the design). Each token is merged on its own: a token changed on one side takes that side; changed on both sides since the last sync it is a conflict, kept as it is on both sides until you choose Use the design or Use the file. A token deleted in the file deletes the variable (layers keep its value). Colors are read from the DTCGcomponents;hexis only a fallback, so change both (or write a plain"#rrggbb"). - Guarded code. Generated code sits between markers such as
/* @ofini-proto begin home hash=5ef7ae30 */ … /* @ofini-proto end home */(<!-- … -->in HTML; for HTML pages only the<body>content is guarded, so the<head>is yours). Code outside the markers is never changed. A region you edited by hand is kept as long as the design does not change it; when both changed it is a conflict: Keep my edits, Overwrite with the design, or look at the diff first. Remove the markers to take a file over completely; the link then leaves it alone. - Live link regenerates the code about 1 s after every design change (while both documents are open); without it, Sync now does it. The Code panel lists every generated file with its state (In sync, Updated, Edited in code, Conflict, Markers removed) and Resolve conflicts….
- Jumps. Open in Code (context menu, Code panel) shows the selected layer's element in the Code studio
(generated HTML carries
data-proto-id); in the Code studio, the Proto badge on a region's first line and Open in Proto (command palette, from the caret or the element selected in the preview) go back to the layer. - Code → design. Update Layer from Code reads a linked HTML screen you edited in the Code studio back into the design through the HTML importer: the layer keeps its id and place, elements keep their ids, colors are bound to the design's variables of the same CSS name. Components are not rebuilt: instances inside come back as plain layers.
- Which layers: Link Selection to Code and Unlink Selection from Code change which layers are written; Unlink ends the link (generated files stay in the project).
The assistant uses proto_code_link (status, link, sync, unlink, refresh from code), and ofini proto link runs
the same sync against a project folder on disk (CLI). The design stores the link (project
name and path, paths, format, layers) and the state of the last tokens sync, so a sync after reopening both
documents still knows which side changed.
Editing together#
A design can be shared live in a collaboration room like every other document (collaboration): right-click the document tab or use File ▸ Share with Collaboration Room… and choose Share as linked live document. Everyone who opens it edits the same design.
- What merges: each layer travels as a few parts (structure and name, geometry, layout, look, content, component data, prototype data), and pages, variables, collections and styles each on their own. Two people who change different parts merge: one changes the fill of a button while the other moves it, and both changes stay. When two people change the same part of the same layer at the same moment, the later change wins on every device and the one whose change was replaced gets a notice.
- Moves never break the tree: when someone deletes a frame while you move a layer into it, your layer stays, at the top level of the page. Two moves that would put two frames inside each other are resolved the same way on every device.
- Undo reverts only your own steps, on top of what the others did since.
- Presence: the others' pointers (with their names) and the outlines of what they selected are drawn on the canvas of the page you are looking at, in their colors. Follow in the Collaboration window shows their page and what they see, and the prototype they preview (Presenting in a live room).
- Images travel in parts, so a large image arrives a little after the layer that shows it. Members who join later get the current design.
Assistant#
With a design open, the Vibe assistant works in it through the tool group Proto. Every change it makes is one undo step labeled Vibe: … and is listed in the AI log like every tool call; the design engine checks each change, so a tool call either applies completely or not at all.
| Tool | What it does |
|---|---|
proto_describe | Outline of the design: one line per layer (id, type, name, size as px, hug or fill, auto layout, fills, text, bindings), components, variables with their modes, styles |
proto_get_node, proto_search | Full JSON of layers (stored or resolved); find layers by name, text, type, component, variable or unbound values |
proto_screenshot | A picture of a frame for the assistant to look at; with compare next to a reference image with a difference score |
proto_new | A new design (empty, desktop or phone frame) |
proto_create | Whole screens or components from one nested spec: auto layout (rows, columns, grids), hug, fill and fixed sizes, fills, strokes, radius, shadows, text, instances, { "$var": "color/primary" } bindings |
proto_write_html | Layers from HTML and CSS (the HTML importer above): agents write HTML fluently, and the result has auto layout, text runs, variables from :root and an import report |
proto_update, proto_move, proto_delete, proto_duplicate | Change fields (shorthands and paths such as layout.gap), bind variables, reorder, reparent, wrap in auto layout |
proto_component | Make components, combine variants, define and bind properties, create, set, swap, override, reset and detach instances |
proto_variables, proto_styles, proto_tokens | Collections, modes (light and dark, brands), variables and aliases, mode per frame; text, effect, fill and grid styles; DTCG import and export, CSS, Tailwind and Swift |
proto_lint, proto_fix | Contrast, touch targets, unbound colors and spacing, spacing off the 4 px grid, values that equal a style, stale overrides, detached copies of components, empty frames, default names, cut-off text, unused tokens; fixes as one undo step |
proto_responsive | The frame at several widths: what overflows and which text is cut off |
proto_content, proto_rename | Realistic text (names, prices, dates or values you give); semantic names and HTML tags |
proto_to_code | The selection, layers or a page as code: HTML + CSS, React (CSS Modules or Tailwind), HTML + Tailwind or SwiftUI, with notes on what the format cannot express |
proto_from_screenshot | An attached screenshot as a locked reference layer next to a frame, with its colors and recognized text (a local text recognition engine where installed); in the app also a suggested auto layout skeleton (one row per horizontal band, blocks as text, buttons and images), which build creates in the frame right away |
proto_design_system | A design system first: color variables with light and dark modes from one brand color, spacing and radius tokens, text and effect styles, and base components with variants (button, input, badge, checkbox, switch, tab, navigation item, avatar, card, list item, stat) on a Components page; what exists by name is reused |
proto_app | A whole app or site from a brief in one step: the design system when there is none, the screens left to right on a Screens page (desktop, tablet, phone or any size), click connections between them and a flow |
proto_restyle | Rebranding through tokens: a new brand color or neutrals (light and dark values recomputed), fonts of every text style, the radius scale, a brand collection that extends the colors, light or dark mode per frame |
proto_responsive_variant | Tablet and phone copies of a desktop screen with the same name (code export merges them into one responsive page): wide fixed widths fill, grids lose columns, rows that overflow wrap or stack, large text and spacing step down; reports what still overflows |
proto_extract_components | Repeated structures (cards, list rows, tags) become a component and instances in place, texts as text properties, other differences as overrides; a dry run lists the candidates |
proto_a11y | Accessibility audit with fixes: contrast (preferring a passing color variable), touch targets (44 or 24 px), alternative text, names of icon-only buttons, heading tags and outline, text under 12 px |
proto_copy | Every text and text property with its role (heading, button, label, body, caption) and a placeholder flag; many texts changed in one step |
proto_critique | A critique package: pictures of the frames plus measured facts (type scale, colors, literal values, spacing off the scale, near-miss alignment, contrast, repeats, hierarchy, density) and a rubric |
proto_template | The starter templates (marketing, mobile, dashboard, design system, portfolio) and a new design from one; proto_new takes a template id too |
The pictures of proto_screenshot come from the layout solver (concept §4.4) painted with the app's fonts, not from
the canvas itself, so they can differ slightly from what you see (text widths, blur effects). Skills for common jobs
(app from a brief, design a screen from a brief, screenshot to editable design, component with variants,
tokens and dark mode, rebrand, responsive variants, extract components, accessibility, copywriting,
critique, prototype a flow, prepare for handoff, design system audit) and the studio guide load on demand.
Coding agents (MCP server)#
Agents outside OpenFini, such as Claude Code, Cursor or VS Code, can read your open designs and, if you allow it,
build and change them through the MCP server: turn it on in Settings ▸ Artificial intelligence ▸ MCP server
(desktop app), allow the agent when it first connects, and copy its configuration from the same page. In a terminal,
ofini mcp relays to the app, and ofini mcp --file design.ofini [--write] serves a saved design without the app.
The agent gets the assistant's tools above under MCP names (proto_get_tree, proto_generate_code, proto_get_tokens,
…); each change is one undo step named after the agent (MCP · Claude Code: …) and appears in the AI log. Agents
read the design's comments (proto_get_comments) and, with change access, answer them (proto_reply_comment, a reply
by MCP · <client> with the AI badge). You allow each agent per design: the prompt names the design, and a design
opened later asks again. Details, tools and security: mcp-server.md.
For developers#
Rulers, guides and layout grids: the pure geometry is app/src/engine/proto/guides.js (tests in
tests/proto/guides.test.js), the canvas part app/src/proto/rulers.js. Templates: app/src/proto/templates/
(builder.js records operations with explicit ids, so a build is either a new model or one undo step; system.js
makes the design system; index.js is the catalog with one lazily loaded module per template; tests in
tests/proto/templates.test.js); the assistant's generators are app/src/proto/ai-design.js.
Code: app/src/studios/proto.js (definition, menus, Labs switch), app/src/proto/ (host, workspace, renderer) and
the pure engine in app/src/engine/proto/. Live collaboration is the records adapter app/src/proto/collab.js
(records, validation and tree repair in its header; tests in tests/proto/collab.test.js) and
app/src/proto/presence.js. The Assets, Variables and binding UI are app/src/proto/panels/{assets,variables,binding}.js
on the pure view models of app/src/proto/panels/model.js (tests in tests/proto/panels-model.test.js); comment pins
and the Comment tool are app/src/proto/comments.js. The assistant's tools are app/src/vibe/tools/proto.js (definitions) with
app/src/proto/ai-ops.js (pure: outline, specs to operations, content, names, responsive check),
app/src/proto/ai-render.js (display list and canvas painter), app/src/proto/ai-runtime.js (undo step, images) and
app/src/engine/proto/lint.js (rules and fixes, shared with the MCP server and ofini proto lint). Code export is
app/src/engine/proto/codegen/ (lower.js builds the one intermediate representation, html.js, react.js,
tailwind.js and swiftui.js print it, index.js ▸ exportCode is the entry point; golden files in
tests/proto/fixtures/codegen/, UPDATE_GOLDEN=1 rewrites them) with the panel app/src/proto/panels/code.js; the Code studio link is app/src/engine/proto/link.js (pure: tokens
three-way merge, file plans, code → design) and regions.js (guarded regions, merge, diff) with app/src/proto/code-link.js
(the controller between the two documents and the dialogs), app/src/proto/panels/link.js (status) and
app/src/ui/code/proto-link.js (badges, Explorer states, Open in Proto); tests in tests/proto/{regions,link}.test.js
and tests/packaging/ofini-proto-link.test.js;
the importers are
app/src/engine/proto/import/ (pure: HTML mapper and static CSS cascade, sanitizer, SVG, Sketch, Penpot, images,
limits; tests in tests/proto/import/) with app/src/proto/paste.js (clipboard, drops, File ▸ Import),
app/src/proto/html-probe.js (the sandboxed preview probe) and app/src/proto/tools/image.js; skills in
app/src/ai/packs/proto.js and the studio guide in app/src/ai/packs/studio-guides.js. The renderer and its
performance are described in the concept
(§4); node scripts/proto-perf.mjs measures the targets of §4.3 in a headless
Chromium-based browser, and tests/proto/perf/bench.html runs the same benchmark by hand in any browser
(node scripts/serve.mjs --root ., then open /tests/proto/perf/bench.html). Prototypes: the model, operations and
smart animate matching are app/src/engine/proto/interactions.js with the expression language expr.js; the player is
app/src/proto/player/ (state.js the pure state machine, render.js one screen, animate.js transitions with the
Web Animations API, core.js the viewport, input and effects, player.js the app's UI, standalone.js the player
of exported files); the Prototype panel app/src/proto/panels/prototype.js, the connections
app/src/proto/tools/connect.js; tests in tests/proto/{interactions,expr,player-state,prototype-html}.test.js. The
HTML prototype export is app/src/engine/proto/prototype-html.js; it inlines prototype-runtime.gen.js, which
npm run proto:runtime (scripts/proto-runtime.mjs) bundles from standalone.js with esbuild. Rebuild it after
changing the player or the engine modules it uses; tests/proto/prototype-html.test.js fails while it is stale.
Edit on GitHub → docs/proto-studio.md