Swagger UI 3.x+ has the plugin system that lets you add or modify UI elements. Some documentation on plugins can be found at:
Plugins
What's the intended way of customizing SwaggerUI 3.x?

and there are some examples here: Plugin catalog.

There is no need to recompile Swagger UI to use plugins, you can actually define the plugins directly in the index.html page. To add or change UI elements, you need a plugin that uses wrapComponents and React.createElement to build the desired DOM structure. (See also React Without JSX.)

For the custom plugins to have effect, they must be added to the plugins list in the SwaggerUIBundle constructor.

Example

Here is a sample plugin that adds custom <h3> headers above and below the API title:

// index.html

<script>
window.onload = function() {

  // Custom plugin that adds extra stuff
  const MyCustomPlugin = function() {
    return {
      wrapComponents: {
        // add text above InfoContainer - same effect as above title
        InfoContainer: (Original, { React }) => (props) => {
          return React.createElement("div", null,
            React.createElement("h3", null, "I'm above the InfoContainer"),
            React.createElement(Original, props)
          )
        },

        // and/or add text above API description
        InfoUrl: (Original, { React }) => (props) => {
          return React.createElement("div", null,
            React.createElement(Original, props),
            React.createElement("h3", null, "I'm above the API description")
          )
        }
      }
    }
  }


  const ui = SwaggerUIBundle({
    url: "http://petstore.swagger.io/v2/swagger.json",
    dom_id: '#swagger-ui',
    ...
    plugins: [
      MyCustomPlugin,       // <------ add your custom plugin here
      SwaggerUIBundle.plugins.DownloadUrl
    ],
    ...

The result looks like this:

Answer from Helen on Stack Overflow
🌐
Swagger
swagger.io › docs › open-source-tools › swagger-ui › customization › plugin-api
Plugins | Swagger Docs
... API DesignAPI DevelopmentAPI DocumentationAPI TestingAPI Mocking and VirtualizationAPI GovernanceAPI MonitoringOpenAPI & Swagger ... A plugin is a function that returns an object - more specifically, the object may contain functions and components that augment and modify Swagger UI’s ...
🌐
Swagger
swagger.io › docs › open-source-tools › swagger-ui › customization › overview
Plugin system overview | Swagger Docs
By default, Swagger UI includes the internal ApisPreset, which contains a set of plugins that provide baseline functionality for Swagger UI.
🌐
GitHub
github.com › kael-shipman › swagger-ui-plugins
GitHub - kael-shipman/swagger-ui-plugins: Useful plugins for Swagger UI v3 · GitHub
A multi-package repository of useful Swagger UI plugins maintained by @shockey.
Starred by 33 users
Forked by 9 users
Languages   JavaScript 70.7% | Shell 21.8% | HTML 7.5%
🌐
Swagger
swagger.io › docs › open-source-tools › swagger-ui › customization › plug-points
Plug points | Swagger Docs
Swagger UI’s internal APIs are not part of our public contract, which means that they can change without the major version change. If your custom plugins wrap, extend, override, or consume any internal core APIs, we recommend specifying a specific minor version of Swagger UI to use in your ...
Top answer
1 of 1
23

Swagger UI 3.x+ has the plugin system that lets you add or modify UI elements. Some documentation on plugins can be found at:
Plugins
What's the intended way of customizing SwaggerUI 3.x?

and there are some examples here: Plugin catalog.

There is no need to recompile Swagger UI to use plugins, you can actually define the plugins directly in the index.html page. To add or change UI elements, you need a plugin that uses wrapComponents and React.createElement to build the desired DOM structure. (See also React Without JSX.)

For the custom plugins to have effect, they must be added to the plugins list in the SwaggerUIBundle constructor.

Example

Here is a sample plugin that adds custom <h3> headers above and below the API title:

// index.html

<script>
window.onload = function() {

  // Custom plugin that adds extra stuff
  const MyCustomPlugin = function() {
    return {
      wrapComponents: {
        // add text above InfoContainer - same effect as above title
        InfoContainer: (Original, { React }) => (props) => {
          return React.createElement("div", null,
            React.createElement("h3", null, "I'm above the InfoContainer"),
            React.createElement(Original, props)
          )
        },

        // and/or add text above API description
        InfoUrl: (Original, { React }) => (props) => {
          return React.createElement("div", null,
            React.createElement(Original, props),
            React.createElement("h3", null, "I'm above the API description")
          )
        }
      }
    }
  }


  const ui = SwaggerUIBundle({
    url: "http://petstore.swagger.io/v2/swagger.json",
    dom_id: '#swagger-ui',
    ...
    plugins: [
      MyCustomPlugin,       // <------ add your custom plugin here
      SwaggerUIBundle.plugins.DownloadUrl
    ],
    ...

The result looks like this:

🌐
Snyk
snyk.io › advisor › swagger-ui › functions › swagger-ui.plugins
How to use the swagger-ui.plugins function in swagger-ui | Snyk
// https://github.com/swagger-api/swagger-ui/issues/4332 if (window.location.search) { window.location.search = ""; } window.ui = SwaggerUI({ deepLinking: true, dom_id: "#swagger-ui", layout: "DashboardLayout", plugins: [ SwaggerUI.plugins.DownloadUrl, vanillaForums ], presets: [ SwaggerUI.presets.apis ], requestInterceptor: function (request) { request.headers["x-transient-key"] = gdn.getMeta("TransientKey"); return request; }, url: gdn.url("/api/v2/open-api/v2"), validatorUrl: null }); });
🌐
GitHub
github.com › swagger-api › swagger-ui › blob › master › docs › customization › plug-points.md
swagger-ui/docs/customization/plug-points.md at master · swagger-api/swagger-ui
SwaggerUI can be configured with the requestSnippetsEnabled: true option to activate Request Snippets. Instead of the generic curl that is generated upon doing a request. It gives you more granular options: ... There might be the case where you want to provide your own snipped generator. This can be done by using the plugin api.
Author   swagger-api
🌐
GitHub
github.com › swagger-api › swagger-ui › wiki › Plugins
Plugins · swagger-api/swagger-ui Wiki · GitHub
April 10, 2024 - Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API. - Plugins · swagger-api/swagger-ui Wiki
Author   swagger-api
Find elsewhere
🌐
GitHub
github.com › swagger-api › swagger-ui › issues › 5027
Plugin catalog ? · Issue #5027 · swagger-api/swagger-ui
November 14, 2018 - Does a plugin catalog exist? I am about to attempt to extend the functionality of swagger-ui but before I do I want to find if someone else has written something similar. Whilst I can find documentation on the plugin API I can't find any...
Author   ChristopherHackett
🌐
Bubble
forum.bubble.io › showcase › plugins
[NEW PLUGIN] Swagger UI - Plugins - Bubble Forum
October 7, 2022 - Have you always wanted to expose your app’s Swagger API documentation from right within your app? Bubble exposes this powerful API documentation tool - the swagger.json file. But until now there’s not been a great way to display your API documentation from within the app.
🌐
GitHub
github.com › swagger-api › swagger-ui › blob › master › docs › customization › plugin-api.md
swagger-ui/docs/customization/plugin-api.md at master · swagger-api/swagger-ui
A plugin is a function that returns an object - more specifically, the object may contain functions and components that augment and modify Swagger UI's functionality.
Author   swagger-api
🌐
npm
npmjs.com › package › swagger-ui-plugin-extra-description
swagger-ui-plugin-extra-description - npm
Swagger-ui plugin to display extra description blocks between info and paths. Latest version: 1.0.2, last published: 4 years ago. Start using swagger-ui-plugin-extra-description in your project by running `npm i swagger-ui-plugin-extra-description`. ...
      » npm install swagger-ui-plugin-extra-description
    
Published   Apr 29, 2021
Version   1.0.2
Author   Damien Villeneuve
🌐
Quarkus
quarkus.io › guides › openapi-swaggerui
Using OpenAPI and Swagger UI - Quarkus
The UI is automatically generated from your OpenAPI specification. The Quarkus smallrye-openapi extension comes with a swagger-ui extension embedding a properly configured Swagger UI page.
🌐
Medium
medium.com › codex › exploring-swagger-codegen-and-swagger-plugins-a8d507b9fd5e
Exploring Swagger Codegen and Swagger Plugins | by Jennifer Fu | CodeX | Medium
May 27, 2021 - Exploring Swagger Codegen and Swagger Plugins Design first or code first, its your call We have introduced the OpenAPI Specification, Swagger Editor, and Swagger UI. Let’s look further into Swagger …
🌐
Spincast
spincast.org › plugins › spincast-swagger-ui
Spincast - Plugins - Spincast Swagger UI
Spincast Swagger UI plugin - display your OpenAPI documentation.
🌐
Litestar
docs.litestar.dev › 2 › usage › openapi › ui_plugins.html
OpenAPI UI Plugins — Litestar Framework
from litestar import Litestar, ... SwaggerRenderPlugin()], ), ) Each plugin can be tailored to meet your unique requirements by passing options at instantiation. For full details on each plugin’s options, see the API Reference. ... path: Each plugin has its own default, e.g., /rapidoc for RapiDoc. This can be overridden to serve the UI at a different ...
🌐
ElysiaJS
elysiajs.com › plugins › swagger
Swagger Plugin - ElysiaJS | ElysiaJS
1 month ago - UI Provider for documentation. Defaults to Scalar. Configuration for customizing Scalar. ... Configuration for customizing Swagger. Please refer to the Swagger specification. ... Determine if Swagger should exclude static files. ... Paths to exclude from Swagger documentation. ... Below you can find the common patterns to use the plugin...
🌐
Reposilite
reposilite.com › plugin › swagger
Swagger UI plugin · Plugins · Reposilite
This plugin mounts · Swagger UI under /swagger route to provide visual dashboard to interact with · OpenApi Specification served by Reposilite under /openapi route. Getting Started · Installation · Plugins · Developer API · Report Issue · Join Discord ·
🌐
WordPress.com
wordpress.com › plugins › browse › swaggerui
Swaggerui Plugins — WordPress.com
Add new functionality and integrations to your site with thousands of plugins. ... WordPress REST API with Swagger UI.