# @scalar/blocks

> Render blocks for your OpenAPI documentation

Latest version **0.1.19** (published 2026-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @scalar/blocks
pnpm add @scalar/blocks
yarn add @scalar/blocks
bun add @scalar/blocks
```

## Health

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

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; popular repo.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.19 |
| Published | 2026-09-19 |
| First published | 2026-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 10 |
| Unpacked size | 329.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 16153 |
| Author | Scalar (https://github.com/scalar) |
| Maintainers | cameronrohani, marclave, scalar_geoff, hwkr, hanspagel, amritk, scalar-machine |
| Keywords | scalar, openapi, swagger, blocks, docs |

## Links

- npm: https://www.npmjs.com/package/@scalar/blocks
- Repository: https://github.com/scalar/scalar
- Issues: https://github.com/scalar/scalar/issues/new/choose
- npm.io page: https://npm.io/package/@scalar/blocks

## Dependencies (10)

- [vue](https://npm.io/package/vue.md) ^3.5.40
- [js-base64](https://npm.io/package/js-base64.md) ^3.9.2
- [@scalar/icons](https://npm.io/package/@scalar/icons.md) 0.7.6
- [@scalar/types](https://npm.io/package/@scalar/types.md) 0.20.0
- [@scalar/themes](https://npm.io/package/@scalar/themes.md) 0.18.0
- [@scalar/helpers](https://npm.io/package/@scalar/helpers.md) 0.12.0
- [@scalar/snippetz](https://npm.io/package/@scalar/snippetz.md) 0.9.31
- [@types/har-format](https://npm.io/package/@types/har-format.md) ^1.2.16
- [@scalar/components](https://npm.io/package/@scalar/components.md) 0.29.3
- [@scalar/workspace-store](https://npm.io/package/@scalar/workspace-store.md) 0.63.0

## Recent versions

- 0.1.19 (latest) — 2026-09-19
- 0.1.18 — 2026-09-18
- 0.1.17 — 2026-09-16
- 0.1.16 — 2026-09-07
- 0.1.15 — 2026-08-28
- 0.1.14 — 2026-08-20
- 0.1.12 — 2026-08-13
- 0.1.11 — 2026-08-13
- 0.1.10 — 2026-08-07
- 0.1.9 — 2026-07-31
- 0.1.8 — 2026-07-16
- 0.1.7 — 2026-07-16
- 0.1.6 — 2026-07-15
- 0.1.5 — 2026-07-15
- 0.1.4 — 2026-07-08
- … 4 more at https://npm.io/package/@scalar/blocks/versions

## README

# Scalar Blocks

🚧 WIP 🚧

---

Scalar is an open-source API platform for teams who want beautiful developer interfaces without vendor lock-in.

- **[API References](https://scalar.com/products/api-references/getting-started)** — Interactive API documentation from OpenAPI and AsyncAPI specs.
- **[Developer Docs](https://scalar.com/products/docs/getting-started)** — Write in Markdown/MDX, generate API references, sync with two-way Git.
- **[SDK Generator](https://scalar.com/products/sdk-generator/getting-started)** — Type-safe SDKs and CLIs in TypeScript, Python, Go, PHP, Java, and Ruby.
- **[API Client](https://scalar.com/products/api-client/getting-started)** — Open-source, offline-first Postman alternative built on OpenAPI.

20M+ monthly npm installs · 15,500+ GitHub stars · MIT licensed · [scalar.com](https://scalar.com)

---

## Usage

```ts
import { createWorkspaceStore } from '@scalar/workspace-store/client'
import { createCodeExample } from '@scalar/blocks/code-example'
import '@scalar/blocks/style.css'

// Load OpenAPI documents
const store = createWorkspaceStore()

await store.addDocument({
  name: 'default',
  url: '/openapi.json'
})

// Mount a block
createCodeExample('#block', {
  // Data Source
  store,
  // Operation
  path: '/hello',
  method: 'post',
  // Configuration
  selectedClient: 'node/undici',
  selectedServer: {
    url: 'https://api.example.com',
  },
})
```

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