Component Basics

What are components in Ditto? Components are text items that are synced across projects and stored in the Component Library for your workspace. Edits to the text or meta-data of a component propagate to all of its instances.

Some key terms to help you get started:

  • Instance - an instance of a component is a text item currently attached to a component. Edits to an instance sync with all instances of the same component.
  • Attaching - attaching a text item in a project to a component turns it into an instance of the component. A text item can be attached to either an existing component or a new component based on the current text.
  • Detaching - detaching a text item unlinks the text item from the component. After detaching from a component, edits to the text item are no longer linked with the instances of the component.

Creating your first component

To create your first component, click a text item in a project and select "create or attach component" in the edit panel.

This will open a modal where you can name your new component (or attach it to existing components once you have others in the component library!). You can view all of the components in your workspace by clicking the "Components" tab at the top of the web-app.

🖋 Drafting Components

You can also draft Ditto Components in your Component Library, without having to create Components from existing text in Figma files! This means being able to create a content component library directly in Ditto that anyone from your team can bring into their projects.

To draft a component, just click the "+ New Component" button in the top right of your Component Library. Drafted components not yet attached in projects will appear as yellow.

🔗 Attaching to existing components

To attach a text item to an existing component, select the name of the component in the modal's dropdown. A preview of the component's text will display as a diff from the item's current text.

Once you attach the text to a component, its text will turn into an "instance" of the component. Edits to the text will be synced with all other instances of the component until it is detached.

🪓 Detaching instances from components

To detach an instance from its component, click the three dots next to the component name in the edit panel. Click "Detach from component". Once you do this, this text item will become a regular text item, and edits will no longer by synced with the component.

Keep in mind, however, that if a component has no instances (i.e. all of its instances have been detached), it will be removed from your component library.

🖋 Renaming components

You can rename a component at any time by selecting the component in the component library and clicking the pen icon next to its name. It'll open a modal where you can rename the component. We have more about how you can use the name of a component to organize your component library here.

🔌 Using components from the Plugin

When you select text in Figma, you can also attach and create new components from the Ditto Figma plugin.

To use Ditto components in your Figma file, you can drag and drop any of the components on the Components tab onto a frame in your Figma file.

You'll notice a 🟣icon for the text in the layer name. The text node in the file will continue to be synced as a Ditto component!

Didn't find what you were looking for?
Contact Support