Libraries

Libraries are Sketch documents with components (Symbols, Text Styles and Layer Styles) that you can share across all of your other documents — and even across whole teams.

When you update components in a Library, documents that use them will get an update notification. You can review those changes and confirm them to make sure you’re always using the most up-to-date components in your work.

Libraries are handy for teams who work on designs that share components like icons, UI elements or branding. But they’re just as handy if you’re an individual. With Libraries, you can quickly insert common components (like Apple’s iOS UI elements) into your designs and be sure they’re always up to date.

Adding Libraries

Open Sketch’s Preferences by choosing Sketch > Preferences (or pressing + , and click on the Libraries tab. From there, you can either drag a Library Sketch document into the window, or use the Add Library… button to browse for it.

To find out more about the options in the Libraries tab, take a look at the Preferences section.

Sharing Libraries

There are a few different ways to share Libraries with others — using a cloud service, sharing via Sketch for Teams or Cloud, or uploading to a server and using RSS for updates.

Using a cloud service (like Dropbox or Google Drive) to share your Library is as simple as uploading the Sketch document and sharing it with the people that need it. They’ll get a notification in Sketch any time you update it.

Using Sketch Cloud to share your Library is also simple. Simply upload your document to Sketch Cloud, open its settings, check Use as Library, then click Save Changes.

Anyone you share this Library document within Sketch Cloud can click the Add Library to Sketch button in the document’s overview to add it as a Library and receive notifications in Sketch when you update it.

Sharing Libraries with Sketch for Teams

If you’re part of a team sharing and discovering Libraries is even simpler. Upload your document to your team workspace, click the cog icon to open settings, check Use as Library, then click Save Changes.

Head back to the Mac app and you’ll find all of the Cloud Libraries for any team you belong to under the Libraries tab in Preferences. You can scroll through and find the Libraries you need, and when you want to use a Library, just click Install.

Using RSS and a server to share your Library is a little more involved. First, you’ll need to host your Library document on a server. Then, you’ll need to create an XML file like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
  <channel>
    <title>My Sketch Library</title>
    <description>My Sketch Library</description>
    <image>
      <url></url>
      <title>My Sketch Library</title>
    </image>
    <generator>Sketch</generator>
    <item>
      <title>My Sketch Library</title>
      <pubDate>Wed, 23 Jun 2019 11:19:04 +0000</pubDate>
      <enclosure url="mysketchlibrary.sketch" type="application/octet-stream" sparkle:version="1"/>
    </item>
  </channel>
</rss>

Inside the XML file, you’ll need to edit the following:

  • <title>  —  The Library’s name that you want to show in Sketch
  • <image><url> —** The default thumbnail URL that Sketch will attempt to use for your library. It should point to a publicly accessible image URL.
  • <item> —  The information between the item tags is what you’ll want to update when you create new versions of your library. You only need one item tag within your feed.

In the the item tag, for each update you’ll need to include:

  • <pubDate>  — The date the library update was published in the RFC822 format.
  • <enclosure> —  The enclosure tag has three attributes: url, type & sparkle:version. The URL should point directly to your Library document’s server location, type should be “application/octet-stream” and finally sparkle:version is a number that should increment with each new update.

Make sure you’re hosting both your XML feed and your Sketch file using either a http or https URL, but not a mix of both.

Finally, use a tool like the Meyerweb URL encoder to encode your XML feed URL and add it on to the following:

sketch://add-library?url=

Enter the full URl (from sketch:// through to the end your encoded URL) into your browser to open Sketch and add your shared Library.

Library Symbols

When you add a Library, you’ll see that Library appear at the top of the Components Panel. Clicking the Library name will allow you to select Symbols, Text Styles and Layer Styles from the Library and drag them onto the Canvas. You can also access Library Symbols from the Insert menu where, instead of the usual Symbols icon, they’ll have a link icon to show they’re part of a Library.

You’ll also find Library Symbols in the Inspector when you swap symbols.

How to Edit Library Symbols

When you double-click a Library Symbol to edit, Sketch gives you some options, depending on where the Library file has been added from.

Double-clicking to edit a Symbol that belongs to a Local Library or a Library on your Personal Cloud will present the following options:

  • Open in Library will take you to the original Library document so you can edit the Symbol’s master. This will update the Library and any documents with instances of that symbol.
  • Unlink from Library will create a local version of the Symbol so you can edit its master in your current document. This will mean you’ll no longer get updates to that symbol if the Library it originally came from gets updated.

If you’re trying to edit a Symbol that’s part of a Team Library on Cloud you’ll see the following options:

  • Open in Library will open original Library document from Cloud. Any changes made here will update the Library for your whole team and any documents with instances of that symbol will reflect the changes.
  • Unlink from Library will create a local version of the Symbol so you can edit its master in your current document. This will mean you’ll no longer get updates to that symbol if the Library it originally came from gets updated.

If you’re using a Library as part of a team, take extra care when editing Symbol masters there. Any changes you make and save will be sent to everyone using that Library.

If the Symbol you want to edit belongs to a Third Party Library like the Apple iOS UI kit you’ll only have the option to Unlink from Library.

Library Styles

Along with Symbols you can share and sync Text and Layer Styles using Libraries. They’ll appear in the Components Panel and in the Components popover under Appearance in the Inspector. You can also access Text and Layer Styles via the Insert menu, and Like Symbols, Library Styles have a link icon next to their group name to indicate they’re part of Library.

How to Edit Library Styles

If you’re using a Library Style (Layer Styles or Text Styles) in your document and want to edit a Layer that uses it, you’ll have a few options to choose from in the Appearance panel in the Inspector:

  • Before you make any edits, you can choose to Create a new local Style from the currently selected Style. This will unlink the style from the Library and create a new local Style in your document.
  • Alternatively, you can choose to Detach the Style from its master, to unlink it from the Library but not create a new local Style.
  • If you make edits to a Library Style, you can choose Create New Style and Replace to unlink it from the Library, create a new local Style and apply those changes to all layers in your document with that Style applied. Alternatively you can choose Reset Style to revert your changes.
  • As long as the Style is not part of a Third Party Library, you can also choose Edit Style in Library to open the Library document that this style belongs to.

Note: Editing a Style in the original Library document will update that Style for anyone using that Library.

How to Create Library Presets

As well as Symbols, Text and Layer Styles, you can use Libraries to sync and share solid, gradient or image fill presets. To create a Library Preset for a color, for example, select a color in the fill popover of your Library document and add it as a preset under Document Colors.

Now, when you’re working in a document that uses that Library, click on the title above the presets in the fill popover and select the Library’s name to view all of the available Library Presets.

Updating Library Components

When Library Components (Symbols, Text Styles or Layer Styles) you use in your document get updated, you’ll see a Library Updates Available badge in the corner of Sketch’s window. Clicking on this will bring up a Component updates dialog.

Select a Component to see what’s changed and check the checkbox if you want to update it in your document. If you don’t want to update a specific Component, uncheck it. When you’re done, click Update Components.

To stop a Symbol from updating double-click any instance of it in your document and click Unlink from Library. This will create a local Symbol on your Symbols page instead.

Tip: For information how to unlink Text and Layer Styles, take a look at How to Edit Library Styles.

Create a Custom Library Thumbnail

If you want to create a custom preview for your Library, somewhere in the document, create a new 1:1 (square) Artboard and give it the name, “Library Preview”.

Last modified on Oct 23, 2019

Was this article useful?

Yes
No

We’re really sorry about that.
Please let us know what you were looking for:

If you need more help or you’d like to report a bug with this content, please contact support.

Thanks for your feedback.
An error occurred, please try again later.

Start working faster today

Available exclusively on the Mac for just $99.