# @sanity/ui-workshop

> An environment for designing, reviewing, and quality-testing React components.

Latest version **3.4.0** (published 2025-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sanity/ui-workshop
pnpm add @sanity/ui-workshop
yarn add @sanity/ui-workshop
bun add @sanity/ui-workshop
```

Provides the command `workshop`.

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.4.0 |
| Published | 2025-10-15 |
| First published | 2021-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 21 |
| Unpacked size | 607.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13 |
| Author | Sanity.io |
| Maintainers | kmelve, bjoerge, rexxars, skogsmaskin, tonina, mattcraig, joneidejohnsen, rubioz, robinpyon, mariuslundgard, sanity-io, evenw, radhe_sanity, rbotten, danielsgroves, judofyr, ryanblock, obliadp, dcilke, madken, fredcarlsen, hermanw, tambet, sgulseth, atombender, simeonsanity, stipsan, snorreeb, rankers, rdunk, michael-sanity, vincentquigley, ritasdias, kenjonespizza, josh_sanity_io, cngonzalez-sanity, jjburbridge, tdfka_rick, ryanbonial-sanity, indrek.karner, ash, sergeisarviro, refiito, drewsanity, kaspar.lippmaa.sanity, dam, simen.svale, tbeseda, daniel.malmer, jordanl17, colepeters, armandocerna, joan_miralles_paez, christianhg, pedro-sanity, jwoods-sanity, tiit.kass.saity, binoy14, pauloborgesf, ausha, chrislarocquesanity, rostimelk, mattlewine.sanity, msfragala, adoprog, tonysanity, betson, georgedoescode, macdonst, eoinsanity, dashedstripes, jmswrnr, snocorp_sanity, mmgj, filmaj, samhem, gu-stav, patricksanity, mads.mogenshoj, sanitytom, sanity-cb, sanitykev, victor.ayogu, ryanbethel_sanity, brianleroux, johnsicili, p10e, krlund, jonahsnider, mwritter, torbratsbergsanity, evelinawahlstrom, jw-sanity, bobinska.dev, oleg1357, josef-sanity, gabe.wyatt, kbrabrand, annez-sanity |
| Keywords | sanity, ui, design, design system, prototyping, testing, qa |

## Links

- npm: https://www.npmjs.com/package/@sanity/ui-workshop
- Repository: https://github.com/sanity-io/ui-workshop
- Homepage: https://www.sanity.io/
- Issues: https://github.com/sanity-io/ui-workshop/issues
- npm.io page: https://npm.io/package/@sanity/ui-workshop

## Dependencies (21)

- [cac](https://npm.io/package/cac.md) ^6.7.14
- [cpx](https://npm.io/package/cpx.md) ^1.5.0
- [pako](https://npm.io/package/pako.md) ^2.1.0
- [vite](https://npm.io/package/vite.md) ^7.1.10
- [globby](https://npm.io/package/globby.md) ^11.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [mkdirp](https://npm.io/package/mkdirp.md) ^2.1.6
- [rimraf](https://npm.io/package/rimraf.md) ^4.4.1
- [esbuild](https://npm.io/package/esbuild.md) ^0.25.11
- [express](https://npm.io/package/express.md) ^5.1.0
- [axe-core](https://npm.io/package/axe-core.md) ^4.11.0
- [chokidar](https://npm.io/package/chokidar.md) ^3.6.0
- [dotenv-flow](https://npm.io/package/dotenv-flow.md) ^4.1.0
- [@sanity/icons](https://npm.io/package/@sanity/icons.md) ^3.7.4
- [esbuild-register](https://npm.io/package/esbuild-register.md) ^3.6.0
- [segmented-property](https://npm.io/package/segmented-property.md) ^4.0.0
- [@vanilla-extract/css](https://npm.io/package/@vanilla-extract/css.md) ^1.17.4
- [@vitejs/plugin-react](https://npm.io/package/@vitejs/plugin-react.md) ^5.0.4
- [@vanilla-extract/dynamic](https://npm.io/package/@vanilla-extract/dynamic.md) ^2.1.5
- [@vanilla-extract/css-utils](https://npm.io/package/@vanilla-extract/css-utils.md) ^0.1.6
- [@vanilla-extract/vite-plugin](https://npm.io/package/@vanilla-extract/vite-plugin.md) ^5.1.1

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@mesalvo/react-ui](https://npm.io/package/@mesalvo/react-ui.md) — 1.7K weekly downloads

## Recent versions

- 3.4.0 (latest) — 2025-10-15
- 4.0.0-beta.8 (beta) — 2026-04-29
- 4.0.0-static.12 (static) — 2025-10-15
- 3.1.3-canary.0 (canary) — 2025-08-06
- 1.0.0-next.3 (next) — 2022-10-31
- 4.0.0-beta.7 — 2026-04-28
- 4.0.0-beta.6 — 2026-04-24
- 4.0.0-beta.5 — 2026-04-21
- 4.0.0-beta.4 — 2026-04-17
- 4.0.0-beta.3 — 2026-04-16
- 4.0.0-beta.2 — 2026-04-15
- 4.0.0-beta.1 — 2026-04-15
- 4.0.0-beta.0 — 2026-04-14
- 4.0.0-static.11 — 2025-08-07
- 4.0.0-static.10 — 2025-08-07
- … 174 more at https://npm.io/package/@sanity/ui-workshop/versions

## README

# Sanity UI Workshop

An environment for designing, reviewing, and quality-testing React components.

```sh
# Install `@sanity/ui-workshop` as dev dependency
npm install @sanity/ui-workshop -D

# Install peer dependencies
npm install @sanity/ui react react-dom
```

[![npm version](https://img.shields.io/npm/v/@sanity/ui-workshop.svg?style=flat-square)](https://www.npmjs.com/package/@sanity/ui-workshop)

## Basic usage

Add a `workshop.config.ts` (or .js) in the root of your project:

```ts
import {defineConfig} from '@sanity/ui-workshop'

export default defineConfig({
  title: 'My UI Workshop',
})
```

Start the workshop

```sh
workshop dev
```

`workshop` will automatically find workshop "scopes" by searching for files mathing these patterns:

- `src/**/__workshop__/index.js`
- `src/**/__workshop__/index.jsx`
- `src/**/__workshop__/index.ts`
- `src/**/__workshop__/index.tsx`

Define your first workshop scope by creating `src/__workshop__/index.tsx`:

```tsx
import {
  defineScope,
  useBoolean,
  useNumber,
  useSelect,
  useString,
  useText,
} from '@sanity/ui-workshop'

export default defineScope({
  name: 'test',
  title: 'Test',
  stories: [
    {
      name: 'test',
      title: 'Test',
      component: TestStory,
    },
  ],
})

const options = {
  None: '',
  Small: 'sm',
  Medium: 'md',
  Large: 'lg',
}

function TestStory() {
  const text = useText('Text', 'Hello, world')
  const boolean = useBoolean('Boolean', true)
  const number = useNumber('Number', 1234)
  const string = useString('String', '...')
  const option = useSelect('Select option', options)

  return (
    <div>
      <h1>This is my first story.</h1>
      <p>Some text: {text}</p>
      <p>A boolean: {boolean ? 'true' : 'false'}</p>
      <p>A number: {number}</p>
      <p>A string: {string}</p>
      <p>An option: {option}</p>
    </div>
  )
}
```

## Styling

In addition to the [CSS features that `vite` supports](https://vite.dev/guide/features.html#css), you can also use [Vanilla Extract](https://vanilla-extract.style/) for styling.

First install the `@vanilla-extract/css` package:

```sh
npm install @vanilla-extract/css
```

Then, add a `style.css.ts` file for your workshop:

```ts
// src/__workshop__/style.css.ts

import {style} from '@vanilla-extract/css'

export const container = style({
  display: 'grid',
  alignItems: 'center',
  justifyContent: 'center',
  height: '100%',
  width: '100%',
})
```

And finally, import the `container` className and use it in your workshop:

```diff
import {
  defineScope,
  useBoolean,
  useNumber,
  useSelect,
  useString,
  useText,
} from '@sanity/ui-workshop'
+import {container} from './style.css'

export default defineScope({
  name: 'test',
  title: 'Test',
  stories: [
    {
      name: 'test',
      title: 'Test',
      component: TestStory,
    },
  ],
})

const options = {
  None: '',
  Small: 'sm',
  Medium: 'md',
  Large: 'lg',
}

function TestStory() {
  const text = useText('Text', 'Hello, world')
  const boolean = useBoolean('Boolean', true)
  const number = useNumber('Number', 1234)
  const string = useString('String', '...')
  const option = useSelect('Select option', options)

  return (
-    <div>
+    <div className={container}>
      <h1>This is my first story.</h1>
      <p>Some text: {text}</p>
      <p>A boolean: {boolean ? 'true' : 'false'}</p>
      <p>A number: {number}</p>
      <p>A string: {string}</p>
      <p>An option: {option}</p>
    </div>
  )
}
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/@sanity/ui-workshop · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
