Templates
NotebooksTemplates provide pre-packaged artifacts for common data-related workflows. Whether you are doing business planning, user research, devops, or running remote meetings and ice-breakers, templates can help you more quickly create expressive, interactive documents with your own data.
This page describes how you can use existing templates to avoid starting your work from scratch, and how to make your own custom templates for reuse by you and your team.
Observable templates
Observable provides a number of pre-made templates for common data-related tasks like boilerplates for basic charts and maps, starters to access APIs or connect to Google sheets, and templates for common analyses for business planning and product insights.
To use an existing template:
- Open a template from our pre-made templates page:
- In the top right of the template, click ‘Fork to get started’ to make your own copy of the template:
In your fork, attach or connect to your own data (e.g. see File attachments).
Replace the template contents with your own data, and make any edits to customize your notebook. Underneath the pre-packaged Templates there is limitless flexibility. The code and data are right there, so you can customize, extend, and re-write any or all of it, as you see fit.
Custom templates
Observable offers the ability to create your own custom templates that can be tailored to exactly suit your working methods. You will be able to create new notebooks even faster because the template is customized to save you from repetitive steps.
Once created, custom templates appear as a choice whenever anyone chooses to create a new notebook.
A few notes on custom templates:
- Any editor can create a custom template.
- Custom templates are in addition to the standard set of pre-defined Observable templates.
- You can group custom templates to match your work projects or work groups.
How to create a custom template
- In your account, create a new collection named Templates. (See How to create a new collection).
- Create the new custom template in a notebook, either from scratch, or by forking one of the pre-defined Observable Templates.
- Add the new custom template to the Templates collection by clicking Add to collection from the notebook menu ().
Note
If a notebook is already in a collection, you will see In collections rather than Add to collection. Either choice brings up the Add to collection modal.
That’s it! Your custom templates will now appear as options to choose from when you create a new notebook. You can put as many custom templates in the collection as you wish.
Grouping templates in sub-collections
If you want to add more organization to your custom templates, you can create sub-collections within your templates collection:
- Create another collection for each group.
- Add that collection to your Templates collection.
- Add notebooks to the collection for each group. (Notebooks can be in more than one collection.)
Note
You can place one or more collections inside your Templates collection, but sub-collections cannot have sub-collections themselves. Sub-collections for templates are limited to one level of nesting.
Hints for using custom templates
- Give your sub-collections useful titles and descriptions to make it easier to find the best templates for a given task.
- When a new notebook is created from a template, it is simply created as a fork of a notebook in the templates collection. If you look at the template notebook, you can see the forks, assuming it has been shared with you.
- Notebooks in the templates collection need to be visible to the user who is creating a new notebook to show up.
- If you want to prevent other users from accidentally modifying the templates, you can share them as View only.