Home
» Wiki
»
How to use Library in Sketch is simple
How to use Library in Sketch is simple
Libraries are Sketch documents that contain elements like Symbols, Text Styles, and Layer Styles that you can share on all other documents, even entire team members.
When updating components in Libraries, documents that use them receive an update notification. You can review these changes and validate them to make sure you always use the latest components for your current job.
Libraries are extremely useful in collaborative design teams, in which they need to share components such as icons, interface elements or brands. However, they are still useful even when you work alone. With Libraries, you can quickly insert common components (like Apple's iOS UI elements) into your designs and make sure they're always up to date.
Open Sketch's Preferences by selecting Sketch> Preferences (or pressing ⌘+ ,) and clicking on the Libraries tab . Here, you can drag a Library Sketch document into the window, or use the Add Library ... button to add the desired data.
Share Libraries
There are several different ways to share Libraries with others such as via cloud services, 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 a Library is as simple as uploading a Sketch document and sharing it with anyone who needs it. They will receive a notification in Sketch every time they update it.
Using Sketch Cloud to share Library is also simple. Just upload the document to this cloud, open its settings, check Use as Library , then click Save Changes .
Anyone who shares this Library document in Sketch Cloud can click the Add Library to Sketch button in the document overview to add it as a Library and receive notifications at Sketch when updating it.
Share Libraries with Sketch for Teams
If it's a part of Libraries shared and discovered by a team, it's even simpler. Upload your document to the team work environment, click the cog icon to open the settings, check Use as Library> click Save Changes .
Return to the Mac application and you'll see the entire Cloud Libraries of any team working in the Libraries tab in Preferences. You can scroll through and find the Libraries you need. When you want to use a Library, just press Install .
Using RSS and a server to share libraries is a bit more complicated. First, you need to host that Library document on a server. Then you need to create an XML file like this:
<? 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>
In this XML file, you need to edit the following:
<title> - The name of the Library to appear in Sketch
<image> <url> - The default thumbnail URL that Sketch will try to use for your library. It will point to the publicly accessible image URL.
<item> - Information between item tags is what you will want to update when creating a new library version. You only need an item tag in the feed.
In that section tag, for each update, you need to include:
<pubDate> - Public date of library update in RFC822 format.
<enclosure> - The attachment tag has 3 attributes: url, type & sparkle: version. This URL should point directly to the server location of the Library document, the type should be "application / octet-stream" and finally, sparkle: version is the latest update version number.
Make sure you have saved both the XML feed and the Sketch file with an URL of the form http or https, but do not combine the two.
Finally, use a tool like Meyerweb URL encoder to encode the URL feed XML and add it as follows:
sketch: // add-library? url =
Enter the full URL (from sketch: // to the end of the encrypted URL) into your browser to open Sketch and add your shared library.
Library icon
When you add a Library, you will see it appear at the top of the Components panel. Clicking on the Library name will allow you to select Symbols, Text Styles and Layer Styles from the Library and drag them into Canvas. You can also access Library Symbols from the Insert menu , instead of the Symbols icon. An associated icon indicates that they are part of the Library.
You will also find Library Symbols in Symbols when you change symbols.
How to edit Library Symbols
When you double-click a Library Symbol to edit, Sketch gives you several options, depending on where the Library file is added.
Double-clicking to edit a Symbol belonging to the Local Library or Library on the Personal Cloud will show the following options:
Open in Library will take you to the original Library document so you can edit the main version of Symbol. This will update the Library and any documents with versions of that icon.
Unlink from Library will create a local version of the Symbol so you can edit its original version in the current document. This means you will no longer receive those icon updates if the Library is initially updated.
If you are trying to edit the Symbol of a Team Library in the Cloud, you will see the following options:
Open in Library will open the original Library document from the Cloud. Any changes here will update to the Library for all team members to see. Any document with versions of that icon will reflect those changes.
Unlink from Library will create a local version of Symbol so you can edit the original copy in the current document. This means you will no longer receive those icon updates if the original Library has been updated.
If you are using a team library, be more cautious when editing the main Symbol here. Any changes you make and save will be sent to everyone who is using this Library.
If the Symbol you want to edit belongs to the Third Party Library. For example, the Apple iOS UI kit will only have the Unlink from Library option .
Library Styles
In addition to Symbols, you can share and sync Text and Layer Styles using Libraries. They will appear in Components Panel and popover Components in Appearance in Inspector. You can also access Text and Layer Styles via the Insert menu. Like Symbols, Library Styles has an associated icon next to the group name to indicate they are part of the Library.
How to edit Library Styles
If you're using Library Style (Layer Styles or Text Styles) in a document and want to edit a Layer using it, you have a few options 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 action removes the link of that type in the library and creates a new local style in the document.
Alternatively, you can choose that Detach Style from its original version, to remove its link in the Library but not create a new local style.
If you are editing a Library Style, you can choose Create New Style and Replace to unlink its link in the library, create a new local Style and apply those changes to all layers of the document with the same Style. use. Alternatively, you can choose Reset Style to reverse any changes.
As long as the style is not part of a third-party library, you can choose Edit Style in Library to open a Library document containing that style.
Note: Editing the Style in the original Library document will update that Style for anyone who uses this library.
How to create presets for libraries
Like Symbols, Text and Layer Styles, you can use Libraries to synchronize and share solid, gradient, or image presets. To create a Library Preset for a color, for example, select the color in the popover that fills the Library document and add it as a preset in the Document Colors .
Now, when you are working in a document using that Library, click on the title above these previous settings in the Fills window, then select the Library name to preview the entire Library Presets available.
Updated Library Components
When Library Components (Symbols, Text Styles or Layer Styles) used in the document are updated, you will see a Library Updates Available badge in the corner of the Sketch software window. Click on it, a dialog box containing Component updates will appear.
Select Component to see the changes and check that box if you want to update it in the document. If you don't want to update a Component, uncheck it. Once completed, click Update Components .
To stop updating a Symbol, double-click any version of it in the document and click Unlink from Library . This action will create a local icon on that Symbols page.
Create a customized Library avatar
If you want to create a custom preview window for your Library somewhere in the document, create a square Artboard (1: 1), then name it "Library Preview".
Above is how to use the Library feature in Sketch graphic design software . Hope the article is helpful to you.