Skip to main content
A component is a design you reuse across a file, such as a button, an input or a card. The original is the main component, and every copy you place is an instance. Change the main and every instance on every page updates. Before you start · Web and desktop · Free plan
Button and Badge main components on the canvas with Sign up, Save and New instances below them, shown in violet in Layers, and the Components panel listing Badge with 1 instance and Button with 2Button and Badge main components on the canvas with Sign up, Save and New instances below them, shown in violet in Layers, and the Components panel listing Badge with 1 instance and Button with 2
You need edit access to the file to create components or change them. Anyone who can open the file can see components, go to a main and select its instances.

Create a component

  1. Select the frames or layers you want to reuse.
  2. Press ⌘ ⌥ K, or:
    • Click Create component in the header of the properties panel.
    • Right-click the selection and choose Create component.
    • Open the command palette with ⌘ K and run Create component.
Each layer you selected becomes its own component, so selecting three layers makes three components. A frame becomes the main where it is: it doesn’t move, and nothing is copied. A text or SVG layer is first wrapped in a frame that hugs it. If the new main has exactly one text layer, it gets a Label text property, so instances can change the words straight away.

Open the Components panel

The Components panel sits in the left sidebar, under Pages and Layers. If it’s collapsed, click its title to open it. To show or hide it, open the Wonder menu > View > Panels > Components, or run Show Components Panel in the command palette. The panel lists every component in the file by name. In its header:
  • Grid view / List view switches how components are shown. In list view, each row also shows how many instances the component has.
  • Search… finds a component by name, or by one of its variant values.
  • Collapse all, which shows while a group is open, closes every open group.
Add / to a component’s name to put it in a group. For example, forms/input puts input in a forms group. You can also drag a component onto another group. Right-click a component for Place, Go to main component, Select all instances, Rename (F2) and Delete component, which says how many instances it has placed, such as Delete component (3 placed). If its main was deleted, the menu also has Restore main.

Place an instance

Place an instance in any of these ways:
  • Click a component in the Components panel. The instance goes inside the selected frame, after the selected instance, or in the middle of your view. Use ⇧-click or ⌘-click to select components in the panel instead.
  • Drag a component from the panel onto the canvas.
  • Open the command palette with ⌘ K and run Place followed by the component’s name, such as Place Button.
  • Copy and paste the main or an instance in the same file. Duplicating a main or an instance (⌘ D) also makes an instance.
A new instance takes the main’s size, its default variant and its Default state. Mains and instances are violet in Layers and on the canvas, so you can tell them apart from plain frames. A main has the component icon, and an instance has an outlined diamond.

Edit the main component

Select the main and change it like any other design: its layers, layout, colors and text. The change reaches every instance on every page, and one ⌘ Z takes it back everywhere. At the top of the properties panel, the main’s section is headed with the component’s name. Once the main has instances, the Instances by page button in that header says how many and where when you point at it, such as Main component · 14 instances on 5 pages. Click it to see the instances page by page. Open Component options in that header for Select all instances, Description, Allow all overrides, Rename component and Remove component. Select all instances selects the instances on the page you’re on. An instance follows its main. You can’t add layers to it, move layers out of it or change the layers inside it, except for the styles its main lets instances override. Change the main instead, or give the main a property for what each instance should change.

Add properties

Properties are what each instance can set for itself, such as a button’s label or whether it shows an icon.
  1. Select the main and click + (Add property) in the header of its section in the properties panel.
  2. Type a Name and pick a Type:
    • Text: the words of a text layer.
    • Visibility: whether a layer is shown or hidden.
    • Icon: which icon a layer shows.
    • Image: which image a layer shows.
    • Variant: see Add variants.
  3. Pick the Layer the property drives, or click the target button and pick it on the canvas.
  4. Click Create property.
The Add property form open beside the Button main component, with an empty Name field, Type set to Variant and the Create property buttonThe Add property form open beside the Button main component, with an empty Name field, Type set to Variant and the Create property button
You can also click the diamond next to a field of a layer in the main (its tooltip says Let instances change this) and choose Create property, or right-click the layer and choose Expose as property and the kind of property. When some text layers have no property yet, Expose all text in the Add property form gives each of them one. To let instances swap a component nested in the main, such as the icon button inside a card, click the diamond on that nested instance and choose Let instances swap this.

Add variants

Variants are versions of a component, such as Primary and Secondary buttons, or Small, Medium and Large sizes.
  1. Select the main and click + (Add property).
  2. Leave the Type as Variant, name it, and click Create property. The property starts with one value, Default.
  3. Open the property’s options and choose Edit property. Click Add value to add a variant, such as Variant 2, and rename the values there.
  4. Pick a value in the property’s row to edit that variant, then restyle it on the canvas.
To delete a value, click Remove value next to it in Edit property. The Default value can’t be removed. A variant can’t move layers or swap icons. Move layers in Default, and to show a different icon, add both icons and show one in each variant.

Add states

States are how a component looks when someone interacts with it. Wonder names them the way CSS does: :hover, :focus, :active (pressed) and :disabled, next to default.
  1. Select the main and click + (Add state) in its State row.
  2. Pick a state, such as :hover.
  3. With that state selected, change the main’s colors, borders, effects or visibility.
The Button main component selected, with the Add state menu open under its State row, listing :hover, :focus, :active and :disabledThe Button main component selected, with the Add state menu open under its State row, listing :hover, :focus, :active and :disabled
A state can only change colors, borders, effects and visibility.

Let instances override styles

By default, an instance looks exactly like its main except for its property values. To let instances change a style of their own, select the main and click the diamond next to the style’s field. Its tooltip says Allow overrides. You can do this for Fill, Border color, Corner radius, Gap and Padding. To let instances change any style, choose Allow all overrides in Component options. When you turn an override off again, instances that had changed that style go back to the main’s.

Change an instance

Select an instance. The section at the top of the properties panel, headed with the component’s name, shows:
  • A dropdown for each variant property.
  • A field for each property: the words of a text, Shown or Hidden, an icon, an image or a nested component to swap in.
  • A State dropdown.
The Sign up instance of Button selected, with its Component section showing the Label field set to Sign up and the State dropdown set to defaultThe Sign up instance of Button selected, with its Component section showing the Label field set to Sign up and the State dropdown set to default
Each changed value has a button to reset it to the main’s value. Revert properties in the section header resets them all. Select several instances of one component to change them together. Open Instance options for Swap component, Reset all changes, Use main size, Detach instance and View inherited styles. Reset all changes is also in the right-click menu and the command palette once the instance has changes. Each instance keeps its own position and size.

Swap an instance

To replace an instance with another component, select it and open Instance options > Swap component, or right-click it and choose Swap instance. Pick the new component from the list. This works on an instance that isn’t inside another instance. To let instances swap a component nested in them, give the main a swap property (see Add properties).
The component picker open for the Sign up instance, with Search components… at the top and Badge and Button listed, Button checkedThe component picker open for the Sign up instance, with Search components… at the top and Badge and Button listed, Button checked
The instance keeps its place and size, and the values of any properties the new component has with the same names. You can also hold ⌥ while you drag a component from the panel onto an instance on the canvas.

Go to the main component

Select an instance and click Go to main component in the header of its section in the properties panel, or right-click it and choose Go to main component. Wonder opens the main’s page if it’s on another one and selects the main. To go back, run Back to instance in the command palette. When a layer inside an instance is selected, the properties panel shows In and the component’s name, with a button that goes to its main.

Detach an instance or remove a component

  • Detach instance (⌘ ⌥ B) turns an instance into a plain frame with the same look. It no longer follows the main. Instances nested inside it stay instances.
  • Remove component, in the main’s Component options, turns the main back into a plain frame. Every instance on every page is detached and keeps its look.
  • Delete component, in the Components panel, deletes the main. Every instance is detached and keeps its look.
Each of these is one undo step. If a main was deleted, its instances say Main component deleted. Click Restore main to bring it back, or Detach to keep the instance as plain layers. When the main can’t be restored, the instance says Main component unavailable. and offers only Detach.

Make and use components with an agent

Agents can create components, place instances of them, add properties, variants and states, and change mains for you. Ask in a Wonder Chat in the desktop app, or from any agent connected over Wonder MCP. For example:
In the desktop app, you can also select frames, click the button at the top-right corner of the selection and choose Create components. Say what to make and send it to the chat. To bring a code library in as components, ask your agent. It makes one main per code component in a frame called Components, with your code’s variants as variant properties. See Bring your code onto the canvas.

See and revert an agent’s change

When an agent changes a component, the chat shows what it reached, such as Changed Button · 9 instances on 3 pages. Click Revert to undo the agent’s change. Edits people made since stay, so a label someone changed after the agent’s edit is kept. Only the agent’s latest change to a component can be reverted from the chat. Anyone who can edit the file can revert it. A change that can’t be reverted says Revert unavailable instead.

Use components in code

When you copy a design as code (right-click, then Copy as > Copy as code) or export it as Tailwind code, each component is written once, and each instance becomes a tag that uses it, with its property values. See Copy and export.

If something goes wrong

  • I don’t see the Components panel or Create component. Reload Wonder. To create or change components, you need edit access to the file.
  • My agent doesn’t create components. Agents outside Wonder pick components up after you reconnect Wonder in them. See Wonder MCP.
  • “Instances follow their main component. Change it there, or detach the instance.” You tried to change a layer inside an instance. Change the main, give the main a property for it, or detach the instance.
  • “Expose this text on the main component to change it per instance”. The text has no property. Click Expose on main to give it one, then change it on the instance.
  • “This is part of an instance. Detach the instance to make a new component from it.” A layer inside an instance can’t become a component. Detach the instance first.
  • “A state changes only colors, borders, effects and visibility” or “Variants can’t move layers. Switch to Default to move them.” Move or resize layers in the Default variant and state.
  • ”… is set on each instance, so variants and states can’t change it”. The layer is driven by a property, so its value comes from each instance, not from the variant or state.
  • “Pasted as plain layers. Components can’t move between files yet.” You pasted into a file where you can’t create or change components. In a file you can edit, a copy you made brings its components along, with their mains in a frame called Components from and the other file’s name.
  • “Pasted as plain layers. Wonder couldn’t confirm you made this copy.” Components come along only in a copy you made yourself. Copy the layers again, then paste.
  • “Couldn’t copy as code” or “Couldn’t export as code”. A component in the selection is missing from the file. Detach those instances and try again.