---
title: Widget checklist
summary: What to check before you save a widget, share it with the team or export it as a widget file.
audience: both
stability: experimental
since: protocol 1
---

# Widget checklist

Go through this before you save a widget, put it on a shared dashboard or export it. Each item links to the page that explains it. The assistant is told most of these; check them anyway in the Studio preview.

## Data

- [ ] Every source is a read-only tool that is installed here, or a web source, and its `key` is a plain identifier (`tasks`, `open_deals`). ([Sources](data.md#sources))
- [ ] Each web source's URL is the public API you mean, read in full, with no key or personal data in it, and `refreshSeconds` respects the API's rate limits. ([Web sources](data.md#web-sources))
- [ ] A count shows `total`, not the length of `items`: a collection's `list` returns at most `limit` items, 20 by default. ([Sources](data.md#sources))
- [ ] Heavy reads are sources, not `spacemix.call`s at render time: sources are cached, calls aren't. ([Data](data.md))
- [ ] `refreshSeconds` fits the data: the default day for most widgets, 3600 for data that must be current within the hour, rarely less. ([The data cache](data.md#the-data-cache-and-refreshseconds))
- [ ] The widget shows nothing a viewer shouldn't see in a shared place: it runs as each viewer, but whatever it reads is on screen wherever it's placed. ([Runs as the viewer](data.md#runs-as-the-viewer))

## Code

- [ ] It renders from `spacemix.onData`, never from `spacemix.data` read once at load. ([`spacemix` in the widget](../reference/widgets.md#spacemix-in-the-widget))
- [ ] Every source is checked with `failed(result)` and rendered with `error(result)`; empty data is rendered with `empty(text)`; every `spacemix.call` has a `catch`. ([Handling errors](data.md#handling-errors))
- [ ] Markup is built with `` html`…` ``, so every value from the data is escaped. ([Building markup](ui.md#building-markup))
- [ ] It is self-contained: inline `<style>` and `<script>`, images only as `data:` URIs, no external scripts, stylesheets, fonts, `fetch` or links that navigate. ([Widgets](index.md#what-a-widget-can-and-cannot-do))
- [ ] The Studio shows no error, and the status dot is not red.
- [ ] The HTML is small: under about 15 KB, and never more than 60,000 characters. ([Limits](building.md#limits))

## Look

- [ ] It is built from `.op-widget` and the kit's classes and helpers, with little CSS of its own, on its own classes and ids only. ([Look and feel](ui.md))
- [ ] No hard-coded colors: `var(--op-…)` and `spacemix.ui.color(i)` only, and it reads well in light and in dark. ([Colors and the theme](ui.md#colors-and-the-theme))
- [ ] It fits any size: no fixed pixel widths, lists scroll with `.op-scroll`, long text is truncated. Try Small and Large in the Studio. ([The grid and sizing](ui.md#the-grid-and-sizing))
- [ ] It still reads at one column, about 350 px wide, as on a phone. ([On a phone](ui.md#on-a-phone))
- [ ] Animations of its own sit inside `@media (prefers-reduced-motion: no-preference)`. ([Reduced motion](ui.md#reduced-motion))
- [ ] It is quiet and clear: one big number or a compact list beats clutter. Rows that stand for an extension's records open it with `data-open`.

## Sharing

- [ ] The name is short and the description says in one line what it shows; both show in the gallery, the add-widget picker and Team Chat.
- [ ] It is saved: a widget that was never saved shows only in its Studio. ([Save, discard, and unsaved widgets](building.md#save-discard-and-unsaved-widgets))
- [ ] Before exporting: whoever imports the file needs the same extensions installed, or the widget shows the missing-extension pill. ([Importing](building.md#importing))
- [ ] Before importing or opening someone else's never-saved widget: read the list of tools it reads in the confirm, and every web address the server will fetch for it. It runs with your access. ([Runs as the viewer](data.md#runs-as-the-viewer))
