> ## Documentation Index
> Fetch the complete documentation index at: https://rive-docs-editor-keyboard-shortcuts-accuracy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Components (formerly Nested Artboards)

> Components streamline your workflow with reusable artboards and animations. Changes made to the source component are reflected across all of its instances.

export const YouTube = ({id, timestamp}) => {
  const videoSrc = timestamp ? `https://www.youtube.com/embed/${id}?start=${timestamp}` : `https://www.youtube.com/embed/${id}`;
  return <iframe width="100%" height="400" src={videoSrc} title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen />;
};

<YouTube id="HRUr9mnh41A" />

## Creating a Component

Any artboard can be converted to a component. To do so, select an artboard on the stage and use the component icon in the inspector to toggle its status.

Alternatively, you can use the `Shift` + `N` shortcut with an artboard selected. If you're coming from Figma, then the `Cmd/Ctrl` + `Alt/Option` + `K`, shortcut will also work.

Select the component toggle in the inspector again to revert your selection back to a regular artboard, or use the `Shift` + `Alt/Option` + `N` shortcut.

Currently, only artboards that have been flagged as components will be exported to your `.riv` file. If you think you may want to programmatically access an artboard at runtime, you should mark it as a component. More options on specific export behaviors are coming soon.

## Using Components

Use the Component Tool — formerly known as the Nested Artboard Tool — to select and place instances of a component on the stage. Select the tool from the toolbar or use the `N` shortcut to enable it.

Click anywhere on the stage to place the component in the desired location. A menu will display available components to instance. If none show up, you may have no artboards marked as components in your file.

<img src="https://mintcdn.com/rive-docs-editor-keyboard-shortcuts-accuracy/Dhs-6MiPKUuKCMq4/images/editor/fundamentals/components-add.gif?s=6adb4aec721613f481dee1aa0b7e4e87" alt="Placing a component instance by clicking stage with the Component Tool and choosing from the menu of available components" width="1280" height="720" data-path="images/editor/fundamentals/components-add.gif" />

Alternatively, select the dropdown menu to the right of the toolbar icon to select the component ahead of time. The menu is informed by the sort mode of the assets tab — the 'Custom' mode will present components as they’re organized in the asset panel, while the 'Source/Type' mode will present components from their source. The latter will become useful with our Libraries feature.

## Configuring a Component Instance

Once you’ve added an instance of a component, select a timeline or state machine for playback.

### State Machines

After assigning an instance, the default state machine is displayed in the inspector.

<img src="https://mintcdn.com/rive-docs-editor-keyboard-shortcuts-accuracy/Dhs-6MiPKUuKCMq4/images/editor/fundamentals/components-statemachine.gif?s=4009ed2be521fb2cb9076c7d2773a135" alt="The default state machine for a placed component instance shown in the Inspector" width="1280" height="720" data-path="images/editor/fundamentals/components-statemachine.gif" />

### Adding an Animation

You can playback any animation associated with a component. You’ll need to add the desired animation to the instance using the plus button in the Inspector.

<img src="https://mintcdn.com/rive-docs-editor-keyboard-shortcuts-accuracy/Dhs-6MiPKUuKCMq4/images/editor/fundamentals/components-animations.gif?s=ae32c712fb7cb55c4f103f9207c02e14" alt="Adding an animation to a component instance by clicking the plus button in the Animations section in the Inspector" width="1280" height="720" data-path="images/editor/fundamentals/components-animations.gif" />

These animations can be used by themselves, mixed with the state machine, or layered with other animations.

Note that before adding the animation, you must select whether it's a simple or remapped animation.

#### Simple

Simple animations are an easy way to playback a component's timeline.

<img src="https://mintcdn.com/rive-docs-editor-keyboard-shortcuts-accuracy/Dhs-6MiPKUuKCMq4/images/editor/fundamentals/components-animation-simple.gif?s=fe7af9f896af3de23fc20bc81a563f85" alt="Keying the start point of a simple animation on the timeline for a component instance" width="1280" height="720" data-path="images/editor/fundamentals/components-animation-simple.gif" />

A simple animation lets you key its start point on a timeline. You also have the option to change the animation's playback speed.

#### Remap

Remap animations allow you to key time values of an animation on the timeline. This lets you stretch, shrink, or even play an animation in reverse.

<img src="https://mintcdn.com/rive-docs-editor-keyboard-shortcuts-accuracy/Dhs-6MiPKUuKCMq4/images/editor/fundamentals/components-animation-remap.gif?s=e02b25633196e9c70c483d39437c892d" alt="Keying time values of a remap animation on the timeline" width="1280" height="720" data-path="images/editor/fundamentals/components-animation-remap.gif" />

Note that the time value is in percent, with 0% representing the start of the timeline and 100% representing the end.

### Mix Value

As you add additional animations to a Component, animations begin to mix together. This mixing is important, especially when multiple animations share keyed properties. Without adjusting this value, your Component may not playback your animations in the way you want.

By default, any animation added to a component starts with a mix value of 100%. You can adjust this value in design mode or in a specific animation by setting keys. **Note that an animation that has a non-zero mix value will always be mixing with other animations, regardless if it has a play key set or not.**

To ensure the correct animation is playing, ensure that you key the mix value for the desired animation to 100%, and all other animations have a mix of 0%.

### Mode (Component Sizing)

Component instances can use **Node**, **Leaf**, or **Layout** sizing to control how they respond to the space available from their parent.

See [Component Sizing](/editor/layouts/component-sizing) to learn how each option scales, fits, or reflows a component.
