Drupal is a registered trademark of Dries Buytaert
drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! linkit 7.0.14 Minor update available for module linkit (7.0.14). masquerade 8.x-2.2 Minor update available for module masquerade (8.x-2.2). video_embed_field 3.1.0 Minor update available for module video_embed_field (3.1.0). bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). editoria11y 3.0.0 Major update available for module editoria11y (3.0.0). trash 3.0.27 Minor update available for module trash (3.0.27). twig_tweak 4.0.0-alpha2 New alpha version released for module twig_tweak (4.0.0-alpha2). twig_tweak 4.0.0-alpha1 First alpha version released for module twig_tweak (4.0.0-alpha1). node_revision_delete 2.1.1 Minor update available for module node_revision_delete (2.1.1). commerce_paypal 2.1.2 Minor update available for module commerce_paypal (2.1.2).

scalar

Security covered
View on drupal.org

Scalar UI integrates the Scalar open-source API documentation library into Drupal, providing a modern, and interactive interface for rendering OpenAPI specifications directly on Drupal site.

This package contains two sub-modules: OpenAPI UI Scalar (openapi_ui_scalar) for rendering OpenAPI specs through the OpenAPI UI plugin architecture, and Scalar UI Formatter (scalar_ui_formatter) for embedding interactive API documentation inside any field using Drupal's Field Formatter system.

If you expose REST, JSON:API, or any other OpenAPI-described service from your Drupal site, Scalar UI gives your developers and API consumers an elegant, fully interactive reference - without leaving your Drupal environment.

Features

This module package bridges Drupal's OpenAPI ecosystem with the Scalar library, offering two modules:

  • openapi_ui_scalar plugs directly into the OpenAPI UI module's plugin architecture becoming selectable as the UI renderer on any OpenAPI UI display page - the same way you would choose Swagger UI or ReDoc. See table here.
  • scalar_ui_formatter is a standalone field formatter for file fields and link fields containing an OpenAPI document URL or uploaded json / yaml specification file. It renders the Scalar widget inline within any node, paragraph, or other entity display - making it straightforward to embed API documentation alongside other content, such as developer portal pages or documentation articles. It is popular solution for integrations such as Google Apigee.

Key features include:

  • Modern, responsive API documentation UI with built-in dark/light mode support
  • Interactive "Try it out" API console allowing users to make live requests from the browser
  • Support for OpenAPI 3.x specifications
  • Zero external SaaS dependency - Scalar renders entirely client-side with no external calls required
  • Plugin-based integration with OpenAPI UI, making Scalar interchangeable with Swagger UI and ReDoc
  • Field formatter integration for embedding API docs directly in content
  • Configurable CDN or local library loading
  • Accessible and keyboard-navigable interface

Configuration

After installing this module via Composer (composer require drupal/scalar), enable one or both sub-modules at Admin → Extend.

Using openapi_ui_scalar with OpenAPI UI:

  • Navigate to any path that uses the OpenAPI UI display, such as those provided by the OpenAPI JSON:API or OpenAPI REST modules.
  • Go to Admin → Configuration → Web Services → OpenAPI and select Scalar as
  • the UI plugin.
  • Save the configuration and visit your OpenAPI documentation path to see Scalar rendering your spec.

Using scalar_ui_formatter as a field formatter:

  • Go to Admin → Structure → Content Types → [Your Type] → Manage Display. For any file field or link field that holds an OpenAPI document, select Scalar API Viewer as the formatter.
  • Configure the formatter settings (such as layout mode and theme) and save. When content with that field is viewed, the Scalar interactive UI will render inline.

JavaScript library

The Scalar JavaScript library is loaded either from a CDN (default, no extra setup needed) or from a local installation under /libraries/scalar if you prefer to self-host it. Library configuration is available at Admin → Configuration → Development → Scalar UI Settings.

Additional Requirements

The following are required depending on which sub-module you use:

  • Drupal 10 or 11 (both supported)
  • OpenAPI UI - required by openapi_ui_scalar only. Provides the plugin architecture that this module implements.
  • Scalar JavaScript library - the @scalar/api-reference library (MIT licensed). Can be loaded via CDN automatically, or installed locally via Composer asset management or manual download to /libraries/scalar.

To install the Scalar library locally via Composer, add the following to your project's composer.json:

"extra": {
  "installer-paths": {
    "web/libraries/{$name}": ["type:drupal-library"]
  }
}

Then run:

composer require scalar/scalar-api-reference

Similar Projects

Several other Drupal modules render OpenAPI specifications. Here is how Scalar UI compares:

  • Swagger UI for OpenAPI UI - The most widely deployed option. Uses the battle-tested Swagger UI library. Scalar UI offers a more modern aesthetic, a built-in dark mode, and a cleaner reading experience, while providing the same try-it-out console functionality.
  • Swagger UI Formatter - Provides a Swagger UI field formatter without requiring the OpenAPI UI module. The scalar_ui_formatter sub-module fills the same role with the Scalar library instead.
  • ReDoc for OpenAPI UI - ReDoc is a documentation-focused renderer with a clean three-panel layout, but it does not include a built-in API console for making live requests. Scalar provides both rich documentation display and an interactive console in a single library.

Supporting This Module

This module is maintained by volunteers. If you find it useful, you can support its continued development in the following ways:

  • Report issues and review patches in the issue queue on Drupal.org.
  • Contribute code via the GitLab repository.
  • Sponsor the upstream Scalar project via their GitHub repository - a healthy upstream means a better module
    for everyone.

Documentation

Activity

Total releases
2
First release
Mar 2026
Latest release
1 month ago
Release cadence
5 days
Stability
50% stable

Releases

Version Type Release date
1.0.0 Stable Mar 17, 2026
1.0.x-dev Dev Mar 12, 2026