# @sanity/default-layout

> The default layout components for Sanity

Latest version **2.36.2** (published 2023-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sanity/default-layout
pnpm add @sanity/default-layout
yarn add @sanity/default-layout
bun add @sanity/default-layout
```

## Health

**Score 40/100 (D)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.36.2 |
| Published | 2023-07-25 |
| First published | 2016-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 539.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6370 |
| Author | Sanity.io |
| Maintainers | jonabc, kenjonespizza, pauloborgesf, binoy14, simen.svale, benjaminakar, svirs, josh_sanity_io, joneidejohnsen, nina.andal, rankers, snorreeb, mattcraig, vincentquigley, stipsan, michael-sanity, rubioz, tonina, ritasdias, simeonsanity, kmelve, bjoerge, rexxars, skogsmaskin, robinpyon, mariuslundgard, sanity-io, evenw, radhe_sanity, rbotten, vicbergquist, judofyr, obliadp, dcilke, fredcarlsen, hermanw, mikolajsanity, sgulseth, atombender |
| Keywords | sanity, cms, headless, realtime, content, default-layout, layout |

## Links

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

## Dependencies (18)

- [rxjs](https://npm.io/package/rxjs.md) ^6.5.3
- [debug](https://npm.io/package/debug.md) ^3.2.7
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [react-rx](https://npm.io/package/react-rx.md) ^1.0.0-beta.6
- [is-hotkey](https://npm.io/package/is-hotkey.md) ^0.1.6
- [@sanity/ui](https://npm.io/package/@sanity/ui.md) ^0.37.22
- [@sanity/base](https://npm.io/package/@sanity/base.md) 2.36.2
- [@sanity/util](https://npm.io/package/@sanity/util.md) 2.36.2
- [@sanity/icons](https://npm.io/package/@sanity/icons.md) ^1.3.4
- [@sanity/logos](https://npm.io/package/@sanity/logos.md) ^1.1.15
- [react-virtual](https://npm.io/package/react-virtual.md) ^2.10.4
- [@reach/auto-id](https://npm.io/package/@reach/auto-id.md) ^0.13.2
- [@sanity/client](https://npm.io/package/@sanity/client.md) ^3.3.3
- [react-focus-lock](https://npm.io/package/react-focus-lock.md) ^2.5.0
- [@sanity/image-url](https://npm.io/package/@sanity/image-url.md) ^1.0.1
- [@portabletext/react](https://npm.io/package/@portabletext/react.md) ^1.0.0
- [@sanity/asset-utils](https://npm.io/package/@sanity/asset-utils.md) ^1.2.5
- [@sanity/generate-help-url](https://npm.io/package/@sanity/generate-help-url.md) ^3.0.0

## Recent versions

- 2.36.2 (latest) — 2023-07-25
- 2.36.6 (v2) — 2024-11-07
- 2.36.2-weighted-search.16 (weighted-search) — 2023-07-14
- 2.34.3-cdr-ga-4.23 (cdr-ga-4) — 2022-10-20
- 2.34.3-cdr-ga-2.19 (cdr-ga-2) — 2022-10-20
- 2.34.3-cdr-ga.20 (cdr-ga) — 2022-10-20
- 2.34.3-cdr-preview.20 (cdr-preview) — 2022-10-20
- 2.34.2-empty-template-cli.0 (empty-template-cli) — 2022-10-13
- 2.34.1-canary.0 (canary) — 2022-10-12
- 2.33.4-shopify.8 (shopify) — 2022-09-22
- 2.33.4-performance-opts.16 (performance-opts) — 2022-09-22
- 2.33.3-edge.8 (edge) — 2022-09-20
- 2.30.7-findability.87 (findability) — 2022-09-20
- 2.33.1-performance-opts-doc-pane.2 (performance-opts-doc-pane) — 2022-09-12
- 2.32.1-next.22 (next) — 2022-09-08
- … 1134 more at https://npm.io/package/@sanity/default-layout/versions

## README

# ⚠️ THIS PACKAGE IS DEPRECATED

> This package is part of Sanity Studio v2, which has been superseded by **Sanity Studio v3**, the current major version released on Dec 7th, 2022. This package is no longer used/needed for Sanity Studio in its current version and will be retired on Dec 7th, 2023. The core packages for Sanity Studio v2 will only receive critical bug fixes until this date.
>
> Please head over to [the documentation for Sanity Studio v3](https://www.sanity.io/docs/sanity-studio) to learn more.

# default-layout

## Sidecar

The Sidecar will be enabled in a Studio if there is an implementations of the part `part:@sanity/default-layout/sidecar`

### `part:@sanity/default-layout/sidecar`

An implementation of `part:@sanity/default-layout/sidecar` _must_ export these:

- `SidecarToggleButton` React component. The button which will appear in the Navbar to toggle on/off the Sidecar
- `SidecarLayout` React component. The content of the Sidecar (once it appears)
- `isSidecarEnabled` Function. Call this to check if the Sidecar implementation is happy and good to go (typically, the sidecar impl. wants to verify if config is present)

If you need inspiration, the `@sanity/studio-hints` package is an implementation of this part.

### `part:@sanity/default-layout/sidecar-datastore`

In addition, Sidecar relies on `part:@sanity/default-layout/sidecar-datastore`. This part already exists and shouldn't be overridden unless there's a good reason. This part exports:

- `isSidecarOpenSetting` listen to this to get realtime updates on the sidecar open/close state
- `toggleSidecarOpenState` call this to flip the sidecar open/close state

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