Symbols: Overrides & Custom Data

Free Sketch Tutorial

Discover how to create and manage reusable elements in Sketch, control symbol overrides, and define custom data sources for text and images for rapid prototyping in our comprehensive tutorial.

This exercise is excerpted from Noble Desktop’s past web design training materials and is compatible with Sketch updates through 2021. Noble Desktop now teaches Figma as the primary tool for web and UX & UI design. To learn current skills in web design, check out our Figma Bootcamp and graphic design classes in NYC and live online.

Note: These materials are provided to give prospective students a sense of how we structure our class exercises and supplementary materials. During the course, you will get access to the accompanying class files, live instructor demonstrations, and hands-on instruction.

Topics covered in this Sketch tutorial:

Controlling Symbol Overrides, Overriding Images Within a Symbol, Custom Data Sources, Masks vs. Image Fills

Exercise Preview

preview custom data

Graphic Design Certificate: Live & Hands-on, In NYC or Online, 0% Financing, 1-on-1 Mentoring, Free Retake, Job Prep. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

Exercise Overview

Symbols let you create reusable elements which can be globally updated, yet at the same time have customized content for each instance. In this exercise you’ll see how to define custom data sources for text and images, which you can use to populate content into multiple instances quickly! This allows for rapid prototyping.

Getting Started

  1. In Sketch, go to File > Open Local Document.
  2. Navigate into Desktop > Class Files > Sketch Class > Pulse and double–click on Symbol Overrides.sketch to open it.
  3. On the Autumn Collection artboard we have created the content we need for each product. Select the following items:

    • photo
    • Product
    • Price
    • Add to Bag button
  4. In the Toolbar, click the Create Symbol button symbol button (or choose Layer > Create Symbol).
  5. In the dialog that appears:

    • Name it Product
    • Set the menu below the name to Top to Bottom Layout.
    • Check on Send Symbol to “Symbols” Page.
    • Click Create.
  6. We need 4 products (in a 2 by 2 grid). Go into the Arrange menu and choose Make Grid.
  7. In the Inspector, set the following:

    • Cells: 2 and 2
    • Spacing: 15 and 30

    Click Finish when done.

  8. The top left instance of our new Product symbol should still be selected. In the Inspector on the right, notice:

    • There’s an option to override the text in Add to Bag. We’d never want to do that, so we’ll be removing this option shortly.
    • There’s an option to override the photo, which we’ll look at in a moment.
    • The Price override is above Product in the Inspector, which is the opposite order found in our layout. It would be nice if the Inspector’s order matched the layout.

Controlling Symbol Overrides

  1. With the symbol’s instance still selected, hit Return to edit the symbol (you could also double–click on it, as long as you aren’t double–clicking on text).
  2. The symbol’s artboard should already be selected, so in the Inspector on the right, find the Manage Overrides section.
  3. Under Add to Bag, uncheck Text Value.
  4. The top to bottom layer order affects the order that overrides appear in the Inspector. In the Sidebar on the left, drag Price down below Product.
  5. At the top left of the canvas, click the Back to Instance button.
  6. In the Inspector, notice two things:

    • You should no longer see an override for Add to Bag (which is good because we don’t want that to change).
    • The top to bottom order of the overrides for Photo, Product, and Price now match the visual order on the artboard. This will be more intuitive when we’re customizing their content.
  7. Select all 4 products on the artboard (drag a selection over them).
  8. In the Inspector on the right, under Price type $79 and hit Return to apply it.
  9. Click somewhere outside the artboard so nothing is selected.
  10. On the canvas select the top right product.
  11. In the Inspector on the right, change the Price to $89 and hit Return to apply it.

Overriding an Image Within a Symbol

  1. Click once on the top left product to select that instance of the symbol.
  2. In the Inspector, under Photo click Choose Image.
  3. Navigate into Desktop > Class Files > Sketch Class > Pulse > Clothing Photos - Women and double–click on blue-top.jpg to choose it.

    NOTE: Unfortunately we cannot change the size, cropping, or position of the image within its mask. So this technique is useful for rapid prototyping and preliminary design, but it’s not suitable for image production. That is often best done in Photoshop anyway once you know how large the photos need to be, or some content management system (CMS) will do that part as well.

Data Sources for Text & Images

  1. Let’s add some product names, but we don’t want to do it manually. Select all 4 products on the artboard (drag a selection over them).
  2. In the Inspector on the right, to the right of Product, click on the Override with Data button override with data button and from the menu choose Sketch Data > Names.

    override with data location

  3. Notice in the canvas that we now have random people’s names instead of product names.

    Sketch only includes a couple examples of custom data, but we can define our own by making a plain text file (.txt) with one piece of data on each line of text. We’ve already made a text file with our product names.

  4. To define our own data source, go into the Sketch menu and choose Preferences.
  5. Switch to the Data tab.
  6. At the bottom click Add Data.
  7. Navigate to Desktop > Class Files > Sketch Class > Pulse and double–click on Clothing Titles - Women.txt to choose it.
  8. Close the preferences window.
  9. In the Inspector on the right, to the right of Product, click on the Override with Data button override with data button and:

    • Uncheck Insert Data at Random.
    • In the menu choose Clothing Titles - Women.

    This is better because it’s now the proper kind of content.

  10. Click somewhere outside the artboard so nothing is selected.
  11. In the top left product, double–click on the product placeholder name and type in Denim Jacket.

    NOTE: There’s no difference between typing overrides directly on the artboard and the Inspector on the right.

  12. Select all 4 products on the artboard (drag a selection over them).
  13. In the Inspector on the right, to the right of Photo, click on the Override with Data button override with data button and choose Unsplash > Search Photo.

    NOTE: Unsplash offers free photos for commercial use. Sketch has integrated a search that will download the images without even having to go to their website! This can be great for placeholder images until you get the final artwork from a client.

  14. In the dialog that appears, type in ladies fashion and click OK.

    • Give it time to download the images, which can take some time depending on your internet speed.
    • After it’s done, you may notice some of the images have been stretched or squished. This happens if they do not match your symbol image’s aspect ratio. For a better fit we could use a custom image data source (which we’ll see in a moment). Alternatively, we could fill a vector shape with the image instead of using a mask, so let’s see how to do that.

Switching From a Mask to an Image Fill

  1. Click somewhere outside the artboard so nothing is selected.
  2. Double–click on the photo of the top left product to edit the symbol.
  3. In the Sidebar on the left, expand the Product Photo group.
  4. Right–click (or Control–click) on the Mask layer and at the bottom of the menu choose Mask (to uncheck it).
  5. Above the Mask layer click on Photo.
  6. Hit the Delete key to delete it.
  7. Click on the Product Photo group.
  8. Hit Cmd–Shift–G to ungroup it (you could also choose Arrange > Ungroup or click the Ungroup button ungroup button in the Toolbar).
  9. In the Sidebar double–click on Mask and rename it Photo.
  10. With the Photo shape still selected, in the Inspector under Fills, click on the color box color selector to open the color picker.
  11. At the top of the color picker click the right-most icon for Pattern Fill pattern fill.
  12. Below the top row of icons, if the Images section is collapsed, click the arrow at the far right to expand that section.
  13. As shown below, in the Images section hover over the thumbnail and click the Choose Image button that appears.

    pattern fill choose image

  14. Navigate into Desktop > Class Files > Sketch Class > Pulse > Clothing Photos - Women and double–click on blue-top.jpg to choose it.
  15. Below the thumbnail set Type to Fill Image.
  16. On the artboard you should see the image looking nice.

    NOTE: One limitation of this technique is you cannot customize the crop, size, or position of the image… which you can’t do when customizing symbols anyway, so this will be fine for our use.

  17. At the top left of the canvas, click the Back to Instance button.
  18. Select all 4 products on the artboard (drag a selection over them).
  19. In the Inspector on the right, to the right of Photo, click on the Override with Data button override with data button and from the menu choose Unsplash > Search Photo.
  20. In the dialog that appears, type in ladies fashion and click OK.
  21. Now the photos should not be distorted because they will automatically fill our shape regardless of their aspect ratio.

Custom Data Sources for Images

  1. Now let’s define a custom data source for our own images. Go into the Sketch menu and choose Preferences.
  2. Switch to the Data tab.
  3. At the bottom click Add Data.
  4. Navigate to Desktop > Class Files > Sketch Class > Pulse, select the folder Clothing Photos - Women and click Open to choose it.
  5. Close the preferences window.
  6. With the 4 products still selected on the artboard, in the Inspector on the right, to the right of Photo, click on the Override with Data button and:

    • Make sure Insert Data at Random is unchecked.
    • In the menu choose Clothing Photos - Women.

Removing Custom Data Sources

We’re done with our data sources, so let’s remove them.

  1. Go into the Sketch menu and choose Preferences.
  2. Switch to the Data tab.
  3. Right–click (or Control–click) on Clothing Photos - Women and choose Remove “Clothing Photos - Women”.
  4. When it confirms, click Remove.
  5. Right–click (or Control–click) on Clothing Titles - Women and choose Remove “Clothing Titles - Women”.
  6. When it confirms, click Remove.
  7. Close the preferences window.

  8. Save the file and close it.

How to Learn Web Design

Master web design with hands-on training. Web design is the creative process of building functional, attractive websites with tools like HTML/CSS, JavaScript, WordPress, and Figma and an understanding of user interface (UI) design principles.

Yelp Facebook LinkedIn YouTube Twitter Instagram