User Guide Cancel

Work with nested components in Adobe XD

  1. Adobe XD User Guide
  2. Introduction
    1. Release updates
    2. Common questions
    3. Design, prototype, and share with Adobe XD
    4. Color Management
    5. System requirements
      1. Hardware and software requirements
      2. Adobe XD, Big Sur, and Apple silicon | macOS 11
    6. Workspace basics
    7. Change app language in Adobe XD
    8. Access UI design kits
    9. Accessibility in Adobe XD
    10. Keyboard shortcuts
    11. Tips and tricks
  3. Design
    1. Artboards, guides, and layers
      1. Get started with artboards
      2. Use guides and grids
      3. Create scrollable artboards
      4. Work with layers
      5. Create scroll groups
    2. Shapes, objects, and path
      1. Select, resize, and rotate objects
      2. Move, align, distribute, and arrange objects
      3. Group, lock, duplicate, copy, and flip objects
      4. Set stroke, fill, and drop shadow for objects
      5. Create repeating elements
      6. Create perspective designs with 3D transforms
      7. Edit objects using Boolean operations
    3. Text and fonts
      1. Work with drawing and text tools
      2. Fonts in Adobe XD
    4. Components and states
      1. Work with components
      2. Work with nested components
      3. Add multiple states to components
    5. Masking and effects
      1. Create a mask with shapes
      2. Work with blur effects
      3. Create and modify gradients
      4. Apply blend effects
    6. Layout
      1. Responsive resize and constraints
      2. Set fixed padding for components and groups
      3. Create dynamic designs with stacks
    7. Videos and Lottie animations
      1. Work with videos
      2. Create prototypes using videos
      3. Work with Lottie animations
  4. Prototype
    1. Create interactive prototypes
    2. Animate prototypes
    3. Object properties supported for auto-animate
    4. Create prototypes with keyboard and gamepad
    5. Create prototypes using voice commands and playback
    6. Create timed transitions
    7. Add overlays
    8. Design voice prototypes
    9. Create anchor links
    10. Create hyperlinks
    11. Preview designs and prototypes
  5. Share, export, and review
    1. Share selected artboards
    2. Share designs and prototypes
    3. Set access permissions for links
    4. Work with prototypes
    5. Review prototypes
    6. Work with design specs
    7. Share design specs
    8. Inspect design specs
    9. Navigate design specs
    10. Review and comment design specs
    11. Export design assets
    12. Export and download assets from design specs
    13. Group sharing for enterprise
    14. Back up or transfer XD assets
  6. Design systems
    1. Design systems with Creative Cloud Libraries
    2. Work with document assets in Adobe XD
    3. Work with Creative Cloud Libraries in Adobe XD
    4. Migrate from linked assets to Creative Cloud Libraries
    5. Work with design tokens 
    6. Use assets from Creative Cloud Libraries
  7. Cloud documents
    1. Cloud documents in Adobe XD
    2. Collaborate and coedit designs
    3. Coedit documents shared with you
  8. Integrations and plugins
    1. Work with external assets
    2. Work with design assets from Photoshop
    3. Copy and paste assets from Photoshop
    4. Import or open Photoshop designs
    5. Work with Illustrator assets in Adobe XD
    6. Open or import Illustrator designs
    7. Copy vectors from Illustrator to XD
    8. Plugins for Adobe XD
    9. Create and manage plugins
    10. Jira integration for XD
    11. Slack plugin for XD
    12. Zoom plug-in for XD
    13. Publish design from XD to Behance
  9. XD for iOS and Android
    1. Preview on mobile devices
    2. Adobe XD on mobile FAQ
  10. Troubleshooting
    1. Known and fixed issues
      1. Known issues
      2. Fixed issues
    2. Installation and updates
      1. XD appears as not compatible on Windows
      2. Error code 191
      3. Error code 183
      4. Issues installing XD plugins
      5.  Prompt to uninstall and reinstall XD on Windows 10
      6. Issues with preferences migration
    3. Launch and crash
      1.  XD crashes when launched on Windows 10
      2.  XD quits when you sign out of Creative Cloud
      3. Issue with subscription status on Windows
      4. Blocked-app warning when launching  XD on Windows
      5. Crash dump generation on Windows
      6. Crash log collection and sharing
    4. Cloud documents and Creative Cloud Libraries
      1. Issues with XD cloud documents
      2. Issues with linked components
      3. Issues with libraries and links
    5. Prototype, publish, and review
      1. Unable to record prototype interactions on macOS Catalina
      2. Issues with publish workflows
      3. Published  links do not appear in browsers
      4. Prototypes do not render correctly in browsers
      5. Commenting panel suddenly showing up on shared links
      6. Unable to publish libraries
    6. Import, export, and working with other apps
      1. Import and export in XD
      2. Photoshop files in XD
      3. Illustrator files in XD
      4. Export to After Effects from XD
      5. Sketch files in XD
      6. Third-party apps not visible in Export

Learn how to work with nested components across design systems in Adobe XD.

Building a design system requires the ability to create components at the molecular levels for optimal reusability and flexibility. When creating components, XD lets you nest them within each other and create complex objects such as menus, card-based layouts, and many more. 

Read on to learn how to create and use nested components for a seamless design experience.

Components
Work with nested components in XD

Before you proceed

Be familiar with these concepts:

Component terminology

Let's first get familiar with some terms associated with nested components:

  • Main component: A main component is the component that defines and controls all component properties.
  • Component instance: A component instance is a copy of the main component and inherits changes made to the main component.
  • Nested component: A nested component is a component inside another component.
  • Outer component: An outer component is a component that has another component inside it.

Create a nested component

Using nested components, you can build more robust design systems. When you update a main component, all its instances receive the update, even if the update was done to a component nested inside it.

To create nested components, you can use any of these approaches:

Approach A: Copy-paste a component instance to a group and convert it to a component.

  1. Create a main button component.
  2. Copy-paste an instance of the button component within a group.
  3. Select the group and convert it to a component. 

Approach B: Copy-paste a component instance inside an already existing component.

Paste an instance of the Button Component inside the group

  1. Create a main button component.
  2. Copy-paste an instance of the button component within another component.

Approach C: Drill down into a part of a component and convert that into a component.

  1. Create a main dialog component.
  2. Drill down to a button inside the component.
  3. Convert the button into a component.

Example

Let’s use Approach A to create a dialog component.

Paste a button instance

Paste the instance

Paste an instance of the button component inside the group.

Convert into a component

Make the Component

Select the group and make it a component.

Create a button component

Create a button Component

Create a button component for the dialog.

Create a dialog container

Dialog container

Create a dialog container with text and other objects inside, as a group.

Best practices

Here are some best practices when creating nested components:

  • You can create a component with multiple components nested inside. However, when components have multiple states with many objects, performance can take a hit. In such cases, to achieve optimal performance, you can nest components three levels deep at most, and limit the number of states per level to a maximum of ten states per component.
  • Do not nest a component within itself. This might result in an invalid component since components are self-referencing.
  • If you have a nested component with multiple states in an outer main component, you can switch the state of the nested component. The state change then propagates to all the outer component’s instances.

Nested components syncing

With nested components syncing, changes made to components nested within a main component propagate to all the instances of that main component. 

Let's see how that works. 

Example 1: A button inside a container that receives changes from the main button.

  1. Create a button as the first main component.
  2. Nest an instance of the button inside a toggle menu.
  3. Nest an instance of the toggle menu inside a container.

Any changes made to the main button component propagate to all the buttons nested inside the toggle menu and the container.

Paste an instance of the Button Component inside the group

Now, create two instances of the main button, two instances of the main toggle menu, and an instance of the main container.

Let's look at some scenarios:

Scenario 1:

Scenario 1

Change the color of the button nested inside the main toggle menu to blue. 

All the buttons nested inside the toggle menu's instances and inside the containers got the color change to blue.

However, the two instances of the main button don't change color. This is because changes to nested components are contextual to their containers. The color change only applies to instances of the button inside the toggle menu. 

Scenario 2:

Scenario 2

Change the color of the button inside the main container to pink. The button inside the container's instance will also turn pink.

Notice that the other buttons don't get the color change. This is because changes to nested components are contextual to their containers. The color change only applies to instances of the button inside the toggle menu within the container. 

Scenario 3:

Scenario 3

Change the color of the button nested inside the container instance to green.

None of the other buttons get the green color change because this change was made on an instance, not a main component, as an override. 

Scenario 4:

Scenario 4

Continuing from scenario 3, change the color of the button nested inside the main container to violet. 

The container instance's nested button does not change color because it already has an override.

Things to watch out for

  • Nested components cannot be main components. So, if you need the change to be on the main component, right-click the nested component and select Edit Main Component
  • If a nested component in an instance of the outer component is swapped, Reset to Main State on the main's nested component will not change the instance with the swapped component. 

Best practices

Here are some best practices when working with overrides in nested component instances:

  • To create a variation of the component for reuse, create a state in the main component rather than an instance with overrides.
  • While overriding instances, ensure that you override the property that does not need updates from the main component. For example, in a button component, overriding the text ensures that the label can be different, but the size and color are still in sync with the main component.

Creative Cloud Libraries help you distribute your design system styles and components to be reused consistently across your documents. To build and distribute a design system through Creative Cloud Libraries, curate your design system assets by adding colors, character styles, and components to the Document Assets panel, and publish them as a library to reuse across all your XD and other Creative Cloud applications. For more information on how to use Creative Cloud Libraries, see Work with Creative Cloud Libraries in XD.

Frequently asked questions

In the previous versions of XD, changes made to a nested component did not update across instances of the outer component. To get an improved experience, open your documents in the latest version of XD.

No. When you open an existing document with nested components in the latest version of XD, XD will automatically migrate those components to the new model to get you going as quickly as possible.

When XD opened your document, these specific components did not match their version in the Assets panel. To migrate without data loss, these main components have been converted to instances on canvas. If you want to bring your main component back to the canvas, right-click the outer instance and select Edit Main Component. Then, if you want your main component to look like the instance on canvas, you can transfer any necessary overrides from your instance to the main component. 

To get updates, open the linked documents in the latest version of XD. Any documents linked in the future should also be opened in the latest version of XD to ensure correct behavior. 

Starting with XD 34, XD no longer supports nesting a main component inside another main component. If you do something that would have previously created a nested main component, the inner component is changed to an instance. 

Learn more

To learn more about nested components in XD, watch this video.
Viewing time: 10 minutes

What's next?

We've got you started on how to work with components in XD. Take a step forward and learn how to share your designs with designers or stakeholders for feedback.

Have a question or an idea?

ask the community

Have a question to ask or an idea to share? Come and participate in Adobe XD Community. We would love to hear from you and see your creations!

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online