Naming your layers can help to keep your Sketch files organized and make them easier for others to work with.
When you create a layer, Sketch will automatically give it a name based on its type or content, but it’s often necessary to rename them to something more descriptive.
Renaming a single layer
When you select a layer in the layer list, you can use Edit > Rename (⌘R) to rename it (like you would with a file in Finder). Type a new name, then press Enter to confirm. You can also rename entire pages using the same command.
Renaming multiple layers
For complex documents, or simply to save some time, you can select multiple layers and quickly rename them in just a couple of clicks.
Start off by selecting the layers you want to rename, then use Edit > Rename (⌘R). Alternatively, you can right/secondary-click on your selected layers and choose Rename from the contextual menu.
To rename all layers on your current page, without selecting them first, you can use Edit > Rename All (⌥⌘R).
In the dialog that appears, you can (optionally) match a specific part of a name to rename, change the case of names, and add numbering, alphabetical sequencing, and dimensions. If you choose to rename all layers on a page, you can also filter the list of layers to only rename layers with certain words or phrases.
- The preview on the left shows the layers you have selected (or filtered) for renaming, and how they’ll change depending on what renaming options you choose.
- The Filter field only appears if you’ve opted to rename all layers on the current page. You can use this to include and rename only layers whose existing names contain a specific word or phrase.
- Match works much like find and replace, where you can change whole words or fragments within current layer names. Layers that don’t match your input will appear faded in the preview on the left. You can also use Match without Rename if you simply want to remove specific fragments from your layer names.
- Optional Match settings include using Regular Expression syntax, as well as Match Case, which makes matches case sensitive. For example, if you have layers named Oval, then oval wouldn’t be counted as a match.
- Use the Rename field to define what your layer names (or matched fragments) will change to. You can also use the dropdown + to add different modifier token combinations, which you can drag forward, backward (or remove entirely) in any order that suits you.
Modifier tokens include:
- Name adds the current name of the layer in full, either as you originally wrote it, or changed to uppercase or lowercase.
- Sequence adds an ascending or descending sequence to the name, either numerical or alphabetical.
- Size represents the layer’s size as width, height, or both. Note that, for ease of use, we add the letter x between width and height — not the multiplication symbol ×.
Once you’ve finished renaming your layers, press Rename button to confirm your changes. You can always undo any changes you’ve made by pressing ⌘Z.
Tip: If you want speed up future layer renaming, you can rename another set of layers using the last renaming format you used via Edit > Rename with Last Format, or press ⌥⇧⌘R.