There will be many similar components when you build a design system. For example, you might have components for buttons with different sizes and colors.
Component sets allow you to organize similar components into one container. This simplifies your libraries and makes it easier for users to find the needed components.
In the example, there is a button component set with 24 variants. The component set has four properties, each containing a set of values.
Motiff identifies each variant through these properties and values while displaying them as instance properties on the right sidebar.
Click next to the property value to switch to the property value as needed. Or use to turn on or off a specific property.
Customizing the properties and values of your variants and naming the deliverables carefully can eliminate disagreements from your design system, avoid guesswork, and align your components more closely with front-end code.
Tip: What's the difference between variants and components set?
Multiple components can be combined into one component set. Each subsets after grouping is called a variant of this component set.
In a component set, you can define different variants by adding any number of properties and values to the variants. You can even map the properties and values of the components sets to code components in the design system.
All variants in a component set share a set of properties and values, but each variants must be a unique combination. You don't need to create a variant for every combination of properties and values.
Motiff uses slash naming to organize components in the Assets panel and the Instance menu. Each / in the component name will form a new hierarchical structure.
This makes it easier to navigate your library or find and swap related components.
Tip: You can change the name of the layers in bulk using the Rename layers modal.
You can also use a specific naming structure to convert existing components into variants. For accurate conversion, the component name needs to follow the following structure:
Note: To ensure accurate conversion, each component needs to have the same number of icons.
For example, one of our button component has the following name: Button/Primary/Large/Default/On .
After conversion, the generated variant will look like the following:
Component set name: Button
Property 1: Primary
Property 2: Large
Property 3: Default
Property 4: On
In the image below, we can see how the component name (on the left) is converted into variant property values (on the right).
Note: Only components can be included within a component set. You cannot add text or annotations, nest frames, or group a subset of variants inside a component set.
If a particular component has many variants, you might want to organize the components in rows, columns, or a grid. This will help convey their multi-dimensional characteristics to anyone who is using your design system. You can also add text next to the component set to annotate the related properties and values.
In the example below, we have arranged the button variants in a grid. We have also added text annotations on the canvas corresponding to the property values.
Tip: By default, component sets have a purple dashed outline with no fill. You can adjust the fill and stroke properties of the component sets to better fit your brand or design system.
Since Motiff doesn't know the property names you need, it will name the first property as Property 1, followed by Property 2, Property 3, and so on after grouping.
You need to rename these properties to more descriptive names.
Note: Similar to regular components, you can add descriptions to component sets, drag the component set from the Assets panel onto the canvas, or replace instances in the Instance menu.
Motiff places variants in one container called a component set. Component sets can only contain components. Click on Create component in the toolbar, or use the shortcuts to create a component:
You can click in the right sidebar to add a variant. This will duplicate the current component and group these two components into a component set.
At this point, Motiff will:
You can also create a new variant by grouping multiple components.
When creating a component set for the first time, you need to add new properties and values to the component set.
Notes:
Continue adding variants to your component set using any of the following methods:
Tip: Dragging in other components will not rearrange existing variants. You can use Smart selection to adjust the layout of the variants.
Note: When you add an instance of the component set to your file, Motiff will import all variants in that component set. Importing large component sets can affect Motiff's speed and performance.
When you add new variants to a component, Motiff defaults to adding variants in a single column with equal spacing between them.
When grouping component sets, Motiff retains the layout of the components before the grouping process.
You can modify Motiff's default arrangement to what you need.
Note: Motiff will use the top-left corner as the default variant. This variant will represent the component set displayed in the Assets panel.
After creation, you can rename and reorder properties and values, or delete properties that are no longer needed.
Note: If you mistype properties or values, a variant property error prompt will appear. To resolve this issue, you need to rename the properties and values of the variant. Although you can fix it by modifying the layer names in the layers panel, we recommend renaming properties and values in the right sidebar instead.
Publish component sets along with styles and regular components to enable members of your team or organization to use them.
Component sets are displayed in the Assets panel along with other components. Motiff will use the top-left variant of the component set as the default variant.
Collaborators can drag the component set into their files to create instances. They can select other variants under the component set by configuring property values in the right sidebar.
Component sets are displayed in the Assets panel along with any regular component. Rather than trying to find specific variants in the panel, you can just select the component set.
After creating an instance of the component set on the canvas, you can configure the instance's property values to select a variant.
Click the Assets tab in the left sidebar, or use the shortcut:
Click on the component set and drag it onto the canvas. Motiff will create an instance of the default variant of that component set.
Select other variants within the component set by configuring property values in the right sidebar.
When you choose to swap between different instances, Motiff will attempt to preserve your overrides.
Motiff uses the following rules to determine whether to preserve the overrides:
For example: In the operations below, Motiff preserved the fill override in step 3 but did not preserve the override in step 4. This is because Motiff will preserve edits of the same layer name with the same property value. Primary Button-Icon On and Primary Button-Icon Off have the same blue #3071FF fill. After changing the fill of the Primary Button-Icon Off variant instance from #3071FF to pink #F531A0 and switching to the variant of Primary Button-Icon On , the override will be preserved.
When switching to the variant of Secondary Button-Icon On , Motiff will not preserve the override because the fill of this variant is white #ffffff , which is inconsistent with the property value of the variant before switching.
Tip: If you are unsure about the different variants in the component set or their original styles, you can select the instance. Click next to the component name in the right sidebar and go to the original file to view the component set.