Skip Navigation

Documentation

Overrides

Updated

Note: Images, videos and some instructions on this page may not be accurate. Please bear with us as we update the Docs for Sketch’s new UI.

Overrides let you easily change the content or style of component instances without affecting other instances or the component source. You can apply and manage overrides for nested components, colors, text properties, images, and Layer Styles.

If you find yourself applying the same set of overrides again and again — to show a button’s hover state, or a dark version of a card, for example — consider using variants instead. Each version becomes a variant of one component, and you switch between them with a property in the inspector, rather than recreating the same overrides on every instance.

How to apply overrides

Select a component instance to see all the available overrides in the Selection section of the Inspector. Each type appears in its own section:

  • Any nested Components within the component and Hotspots that they contain
  • The Text values you can set for the component, along with any applied Text Styles
  • Text Attributes like font weight, size, and alignment
  • Any Layer Styles applied to layers in the component
  • All the Images used within the component, so you can replace them in one place
  • All the Colors used in the component — with Color Variables shown first, making it easier to update them across all matching layers

Hover over any override to highlight every layer that uses it on the Canvas — so you can see every affected layer before you make a change.

An overview of overrides for a selected component instance in the Inspector.

The Inspector only shows the overrides you’ve added in your component source. For example, if a component doesn’t include any images, the Images section won’t appear. Since the Inspector groups overrides by type, you can make bulk changes to colors, Styles, text, and images throughout a component.

If you want to override something in a specific layer inside a component, hover over the layer on the Canvas, hold ⌘, and click. This lets you select the layer, no matter how deeply it’s nested in the component. Alternatively, you can double-click the component instance on the Canvas to step into its layer hierarchy.

As you change your selection, the Inspector updates to show only the overrides that match the selected layer.

Hiding layers in component instances

You can hide any layer inside a component instance. It’s useful to adapt the same component to different scenarios. For example, if you only need 4 menu items instead of the 5 items set in the component source.

There are several ways to hide layers. Select an instance and expand it in the Layer List by clicking the chevron.right next to its name. Find the layer you want to hide and select any of these options:

  • Hover over the layer you want to hide and click the eye icon eye to hide it.
  • Use the contextual menu: select the layer you want to hide, ⌘-click it, then select Hide layer.
  • Use the shortcut ⇧⌘H to toggle the layer’s visibility.

Hidden layers show this icon eye.slash on the Layer List.

Text overrides

You can change the contents of text overrides in a couple of ways. You can double-click a text layer in a component instance on the Canvas and type new content, or type into the override field in the Inspector. Clearing the field resets it to the text in the component source. You can also use Data to populate text Overrides by clicking the Data icon circle.data.button.

You can override text in components either from the Inspector or directly on the Canvas.

Styling text overrides

You can use Markdown-like syntax in component instance text overrides:

  • Use two asterisks ** for bold
  • Use two underscores _ _ for italic
  • Use two angle brackets [ ] for underlined text

Alternatively, you can select the text on the Canvas and use the shortcuts ⌘B, ⌘I, and ⌘U respectively.

To escape Markdown formatting, place a backslash (\) directly before the first formatting character.

Overriding Text and Layer Styles

If you’ve set up Text Styles menu.text.styles or Layer Styles paint.brush in your design, you’ll find these in the Text Attributes and Layer Styles sections in the Inspector. The drop-down lets you quickly swap a Style across the whole component. If you want to override text properties like weight, color, or alignment for a specific layer, select the layer in the Layer List or by double-clicking through the component on the Canvas, then adjust those properties in the Inspector.

Image overrides

You can override any image layer or shape with a fill in the Inspector. You can either drag an image onto the preview, or choose Choose Image…. You can also use Data to populate individual image Overrides by clicking the Data icon circle.data.button.

Color overrides

The Colors section in the Inspector lists all the colors used within a component instance. Click any color to open the Color Panel — the change applies to every layer in the component that uses it. You can also hover over the color swatch to highlight matching layers on the Canvas, or click the chevron on a color row to select them.

An image showing the Colors section in the Inspector for a component instance

The Colors section in the Inspector for a component instance.

You can reset individual color overrides or the entire section at once — see Resetting overrides for details.

The Colors section also works outside components — for plain layers or mixed selections. Learn more about Selection colors.

Resetting overrides

You can reset overrides at different levels, depending on how much you want to undo.

Resetting a whole section

Click the reset button arrow.counterclockwise next to the Selection heading in the inspector to reset all overrides in your selection in one click. This removes every override and restores the original values. The button only appears when your selection has overrides to reset.

How to reset all overrides on a component instance at once.

Resetting individual overrides

For more control, hold ⌥ to reveal a Reset Overrides button on each override row. Hover over it to preview which layers will change on the Canvas, then click to reset just that override.

How to reset a single override on a component instance.

Managing overrides

Select a component source and click the gear icon gear in the Inspector to open Component Settings, then switch to the Overrides tab — it shows all available overrides. By default, all overrides are enabled.

To restrict certain overrides, uncheck the box next to their name. To disable all overrides at once, turn off the Allow overrides option at the top.

Sketch remembers which tab you last used, so Component Settings reopens on Overrides next time if that’s where you left it.

For a component with variants, select a variant and open Variant Settings to manage the overrides for that variant. The Availability settings apply to the whole component.

Manage overrides easily by toggling them on and off.

Overriding nested components

The Components section lists which nested components your component contains — you can swap them as you wish. Hover over any nested component in the list to highlight it on the Canvas.

When you swap a nested component inside another component that uses a Stack layout, the new component preserves the dimensions of the previous one. This means you don’t need to manually adjust sizes when swapping.

Swapping nested components in a component’s overrides in the Mac app.

You can use the chevron chevron.right to select specific nested component instances and apply overrides to them.

Did you find this useful?