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:
👉 Quick note: Components are only available for linkable groups of text in Ditto, not draft groups of text. For more information on the difference between linkable and draft groups (as well as how to use each), head to our guide to drafting text in Ditto.
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.
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.
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.
You can also browse your component library and reuse text from it directly in the Figma plugin, without leaving the Figma file!
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.
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.
When you select text in Figma, you can also attach and create new components from the "Selected" tab of the Ditto Figma plugin.
When you attach text in Figma to a Ditto component, 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!
In our Figma plugin, you're also able to view Component Suggestions in the "Components" tab. Here, Ditto components most similar to text in the project can be viewed and attached. For more about Component Suggestions, check out this Help Guide.