Component properties

Component properties enables different variations of a component to be incorporated into a single component or component set.

Component property types

Component properties include the following types:

  • Variant property
  • Show / Hide property
  • Text content property
  • Instance swap property
  • Slot property

Variant property

The variant property enables you to individually customize attributes for each variant within a component set. You can define attributes such as state, color, and size. Each variant property value is assigned to a specific variant.

Some aspects of a component can be tied to corresponding properties such as show / hide, text content, instance swap, or slot. These properties reduces the number of component variants that need to be created -- which means fewer operations, convenient management, and improved performance due to smaller file sizes.

img

Show / Hide property

The show / hide property is a boolean attribute used to control the visibility of layers within a component. If a show / hide property is created for layer visibility, and its value is set to Hide, any associated layers will be hidden. Once changed to Show, the associated layers will be displayed.

img

Text content property

When applying text content property, you indicate which text layers are editable. Your collaborators can still modify text content not linked to this property in instances, but you might not recommend doing so. Default values for text content properties can be modified from the right sidebar or on the canvas and the modification will be synced automatically.

Note:The text content property currently does not support rich text, such as list styles, superscript, and other type settings. You can still apply these settings to text layers, but their formats won't be displayed and modified in the component properties panel of the right sidebar.

img

Instance swap property

The instance swap property indicates which instances within a component can be swapped. When creating an instance swap property, you can define default instance values from any local and enabled libraries. You can add preferred values to make it easy to find which icons can be swapped.

More tips about preferred values in part Preferred values of instance swap property.

img

Slot property

Slots enhance component flexibility by designating an area as a slot, providing users with the space to tailor designs to specific needs. This allows design system creators to more effectively balance consistency and flexibility within their design systems. Additionally, you can define the layout properties of specific areas within a component, similar to the show / hide property and other properties.

More tips about the slot property in Use the slot property.

img

Create component properties

You can create component properties from two levels: the child layer of a component or component set (referred to as the child layer below) or the component or component set's own layer (referred to as the parent component below) .

Create from child layers

You can create show / hide, text content, instance swap, and slot properties from the child layers, and the properties will be linked to the specific layers without additional steps.

Steps:

  1. Select the child layer in a component or variant.
  2. Click the Link to component property icon in the section corresponding to the component property you want to create. If a dropdown menu appears, click Create new property.
  3. Name the current property and set the default value in the Create component property panel. Click Create.

img

Create from the parent component

You can create all types of component properties from the parent component, but you need to link the child layers to the component property.

Steps :

  1. Select a component or component set, then access the properties section in the right sidebar. Pick the desired component property from the dropdown menu of options.
  2. Set your property name and default values. Click Create to create a new property.
  3. Select the layer for which you want to create properties. Click the Link to component property icon in the corresponding section of the component property you want to create. Select the property name you want to link from the dropdown menu.

Here's an example of creating the text content property from a parent component. Creating other properties follows a similar process.

img

Manage component properties

You can manage component properties by renaming, changing default values, detaching, deleting, reordering, and more.

Rename and change default values

Select the component set or component and click on the corresponding property in the right sidebar, you can rename all types of component properties and change the default values of show / hide, text content or instance swap properties. If the instances of the component have not applied property overrides, updating the default value will sync to the instances.

Note: The default value of a variant property is determined by the variant in the top left corner of the component set.

img

Detach properties

Select the child layer that is linked to a component property and click the Detach icon next to the property in the right sidebar, you can detach show / hide, text content, instance swap, or slot properties from the layer.

Note: This action will only detach the component property from the layer. The component property itself will not be deleted.

img

Preferred values of instance swap property

You can add a list of components as preferred values when creating or managing instance swap properties. This feature helps you identify recommended replacements for the nested instance and easily select the one you would like to swap to.

To add a preferred value for instance swap properties:

  • Select the component set or component and click on the instance swap property in the right sidebar
  • Click the + icon next to Preferred values
  • Browse or search to find the component you want to add as a preferred value, and click to check it

img

To remove a component from the preferred values list, you can click the - icon on the right side of the preferred values list. This won't delete the component itself.

Expose nested instance properties

When an instance is nested in a top-level instance, you have to select the nested instance layer to change its displayed properties. With Expose nested instance properties, you can select the top-level instance and change properties of the nested instance directly.

Steps:

  • Select the component set or component
  • Click the + icon to the right of Component properties
  • Click Nested instances in the dropdown menu and check the checkbox of the nested instance you want to reveal in the right sidebar

img

A list of the exposed nested instances will be displayed in the right sidebar. You can click the - icon to remove them from being exposed.

img

πŸ‘πŸ» Helpful or πŸ‘ŽπŸ» Not Helpful

πŸ‘‰πŸ» Was this article helpful to you? We look forward to your feedback.
πŸ‘πŸ» Helpful
πŸ‘ŽπŸ» Not Helpful