npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

create-swagger-ui-with-sidebar

v1.0.11

Published

<p align="center"> <img src="https://raw.githubusercontent.com/dimitriharding/create-swagger-ui-with-sidebar/main/media/logo.svg" height="150"> </p>

Downloads

9

Readme


Usage

$ npx create-swagger-ui-with-sidebar@latest docs #folder name can be anything

Navigate to folder, and install dependencies and then start development serve

$ cd docs && npm run dep && npm run dev

That's you can edit config and add definitions to public folder or reference remote files


Configuration (project-directory/config.js)

| Config Property | | | ----------------------- | ------------------------------------------------------------- | | config.definitions | List of definition names and their URLs (icons coming soon) | | config.sidebarConfig | Update title, and extend theme | | config.swaggerUIProps | Add additional props for Swagger UI react |

Folder structure

|- 📁 root # Project directory
    |- 📁 public/ # Files to be served at the root of the project
        |- 📁 assets/ # Logo for sidebar and favicon for browser
            |- 🖼 logo.svg
            |- 🖼 favicon.ico
        |- 📁 definitions/ # Local definitions
            |- 📝 {definition}.{yaml|json}
            |- 📝 ...
            |- 📝 ...
    |- 📁 template/ # The react project, normally you don't need to edit the files here
        |- 📁 src # Source code for react app
    |- 📝 config.js # Configuration file for entire project
    |- 📝 package.json # Contains script to interact with template project

Motivation

Wanting to document multiple AWS API gateway services where each service is also deployed on 3 environment (servers) in one location and make it easy to manage multiple swagger definition files.

A sidebar seemed to be the best solution, so that's how this project was created as a weekend project.

How it works

The base template is a vite react-ts project that is very customizable. While you can edit all of the the source file, the intention of this is that you don't have to.

All you should need to do it update the config.js and add definitions to the public folder.

Swagger definitions are handled by the Swagger UI React module

And finally, the sidebar was created with components from Chakra UI


Road Map

- [x] Create Swagger UI project with sidebar from on command
- [x] Add brand/color options (based on Chakra UI colors)
- [] Expose customization for **config** file through CLI
- [] Expose customization for **Swagger UI** props through CLI
- [] Add continuation option for perviously created projects
- [] Add icons support for sidebar (maybe FontAwesome)
- [x] Allow rebuild of existing project for config changes outside of development
- [] Delete template folder on build (optional)