Skip to content

Specs ​

A spec is a document that sits on the canvas next to the designs it describes. Its text is Markdown, and each block of it is a layer: headings, paragraphs, lists, quotes, code, and instances of your components.

A spec beside the Button component set: a heading, a paragraph showing two variables' values, a live Button instance, a to-do list, and the Theme collection as a tableA spec beside the Button component set: a heading, a paragraph showing two variables' values, a live Button instance, a to-do list, and the Theme collection as a table

Add a Spec ​

Press D, then click where the spec should start. It opens with a heading ready to type over.

To start from a file, drop a .md file on the canvas, or choose File → Place…. Opening a .md file with File → Open makes a new document with the spec in it.

Write in a Spec ​

Double-click a block to type in it. The caret lands where you clicked, and clicking another block of the same spec moves into it. Bold, italic, links, and lists work as they do in any text.

Each block you change writes its Markdown back. The blocks you did not touch keep the Markdown exactly as it was written.

While you type, the keyboard moves between blocks as in a document:

  • Enter splits a paragraph or heading at the caret; after a heading the rest becomes a paragraph. In a list or quote it starts a new item or line, and on an empty last line it leaves for a new paragraph.
  • ⌫ at the start of a block joins it to the end of the block above.
  • The arrow keys go on into the block above or below from a block's first or last line, and into the next block from its start or end.
  • Tab nests a list item under the one above, and ⇧Tab takes it back out.

Type / at the start of a block, or after a space, to open a menu of blocks to insert: the block types, a divider, and the document's components. Keep typing to filter it, such as /head for headings or /butt for a Button component, then press Enter or click a row. A block left empty becomes the one you pick; otherwise the pick follows it. A divider or component is followed by a new paragraph to type into. Esc closes the menu and leaves the / as typed.

The / menu of a spec: Paragraph, three headings, bulleted, numbered, and to-do lists, Quote, and Code blockThe / menu of a spec: Paragraph, three headings, bulleted, numbered, and to-do lists, Quote, and Code block

Type shorthand at the start of a paragraph, followed by a space, to turn it into another block:

TypeTo get
#, ##, ###Heading 1, 2, or 3
- or *Bulleted list
1.Numbered list
[] or [ ]To-do list ([x] for a ticked item)
>Quote

While you type in a block, the Spec section of the Design panel formats it with what Markdown can hold: Block turns it into a paragraph, a heading, a list, a to-do list, a quote, or a code block, and Text formatting makes the selected words bold, italic, struck through, or code. Link links them. Font, size, and color belong to the spec, so they are not offered.

Click a to-do item's box to tick it or clear it; its Markdown follows as - [x] or - [ ].

Inline Markdown takes its style as you type its closing mark: **bold**, *italic*, ~~strikethrough~~, and `code`. Typing goes on in the paragraph's own style after it.

Type ```, optionally with a language such as ```ts, and press Enter for a code block. Each of these changes is one undo step, after the typing before it, so undo right after shorthand brings the typed characters back.

Edit the Markdown ​

Select the spec and open the Code tab, or click Edit Markdown in the Spec section of the Design panel. The Code tab shows the spec's Markdown, highlighted, with its lines numbered, and the spec follows as you type. Blocks that stay the same keep their layers, so comments and selections on them stay put, and one undo takes back everything typed since the spec was selected. Type :: for a block such as ::instance, inside component="" for the document's components, or after a code fence for its language. When the spec changes on the canvas, from an agent, or from a collaborator, its Markdown in the Code tab follows. Typing that is still being applied is made again on top of such a change, so a collaborator's edit of another block is kept. The block around the cursor is outlined on the canvas, as an element of Design JSX is.

The Code tab showing the selected spec's Markdown, with numbered lines, beside the spec on the canvasThe Code tab showing the selected spec's Markdown, with numbered lines, beside the spec on the canvas

Show a Component ​

An instance block shows a real instance of a component in the document:

md
::instance{component="Button" variant="Primary" label="Pay now"}
::

component names the component or component set. Other attributes pick its variant and set its properties, as design JSX's <Instance> does. A block naming a component the document lacks shows its Markdown instead.

The instance is an instance like any other on the canvas: double-click into it to select its layers, change its variant and properties in the Design panel, or edit its text. The block's Markdown follows, with anything the instance overrides written in its props. Swapping an instance nested inside it is written too, as an Icon:component override. A change its props cannot describe, such as a value bound to a variable, shows on the canvas but leaves the block's Markdown as it was; expose such a layer as a component property to keep it in the Markdown.

Show Variables ​

A token shows a variable's value in the words of a block:

md
Buttons use :token{name="color/primary"} on a :token{name="radius/md"} corner.

The spec shows the value in the mode it is in, a colour after a swatch, and shows it again whenever the variable changes, while its Markdown keeps naming the variable. Name a variable by its own name, or by its collection's name and its name, such as Colors/color/primary, where two variables share a name. A token whose variable is missing shows its name.

A tokens block shows a whole collection as a table, one row per variable and one column per mode:

md
::tokens{collection="Colors"}
::

Type / and the name of a variable or collection to insert either. The Spec section of the Design panel lists the variables a spec shows; open one there to edit it in the Variables dialog.

Share a Spec ​

  • Copy Markdown in the Spec section, or Copy/Paste as → Copy as Markdown in the canvas menu, copies the spec's Markdown.
  • In the Export section, add an export and choose MD to save it as a .md file, or Spec bundle to save a .spec.json file that also holds the values of its tokens and images of its instances, which a website renders as described in Designs in Markdown. A site can also show the document's specs, components, and tokens straight from the .fig file.

Blocks copied from a Figma Spec paste onto the canvas as a spec of their Markdown, and a spec copied with Copy as Markdown pastes into a Figma Spec as its blocks.

A comment pinned to a spec stays on the block it was left on as the blocks above it change, and on the spec if that block is removed.

Agents place, read, and edit specs the same way, with the create_spec, get_spec, edit_spec, and set_spec tools. See MCP server.