• Stars
    star
    1,523
  • Rank 29,805 (Top 0.7 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build beautiful, interactive API Docs with embeddable React or Web Components, powered by OpenAPI and Markdown.

Elements - OpenAPI Powered API Documentation

Storybook CircleCI NPM Downloads Stoplight Forest

Beautiful API documentation powered by OpenAPI and Markdown. Use these UI components to create API reference documentation, or more complete documentation with Markdown articles covering tutorials, how-to guides, etc.

Available as React Components, or Web Components, you can use Elements all together to build beautiful three-column "Stripe-esque" documentation, or stacked documentation thats easier for integrating into existing Content Management Systems with their own navigation.

Overview

📖 Community

Let's chat about features, ideas, what you're doing with Elements, on GitHub Discussions.

👁️🗨 ️️Examples

Stoplight Elements comes with a few example integration projects, showing you how to utilize Elements with different frameworks.

  • react-cra - An example app built Create React App utilizing Stoplight Elements.
  • react-gatsby - An example Gatsby site utilizing Stoplight Elements.
  • angular - An angular app utilizing the Web Components distribution of Elements.
  • bootstrap - A single HTML page utilizing the Web Components distribution via a global script tag.

To run these examples yourself:

  1. Clone this repo.
  2. Go to examples folder and open an example, e.g.: examples/angular.
  3. Run yarn to install all dependencies.
  4. Run yarn start to run the example.

Note: for bootstrap example just go straight to its directory and open the HTML file.

🏁 Usage

The examples will hopefully help show Elements working in close to real world situations, but the most bare bones examples of Elements can be found below.

React Component

$ npm install @stoplight/elements
import { API } from "@stoplight/elements";

<API
  apiDescriptionUrl="https://api.apis.guru/v2/specs/github.com/1.1.4/openapi.yaml"
  router="history"
/>

For more information on using Elements as a React component, head over to our React documentation.

Web Component

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Elements in HTML</title>
    <!-- Embed elements Elements via Web Component -->
    <script src="https://unpkg.com/@stoplight/elements/web-components.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/@stoplight/elements/styles.min.css">
  </head>
  <body>

    <elements-api
      apiDescriptionUrl="https://api.apis.guru/v2/specs/github.com/1.1.4/openapi.yaml"
      router="hash"
      layout="sidebar"
    />

  </body>
</html>

Load this page up in your browser and you should see the GitHub REST API documented in Stoplight Elements.

For more information on using Elements as a Web Component, head over to our Web Component documentation.

🚧 Roadmap

  • API Console (a.k.a "Try it!")
  • Automatic Code Samples
  • Automatic Examples
  • React & Web Component Support
  • OpenAPI Support
    • OpenAPI v3.1
    • OpenAPI v3.0
    • OpenAPI v2.0
  • Callbacks
  • Webhooks
  • Multiple APIs (a.k.a "Dev Portal")

Submit your ideas for new functionality on the Stoplight Roadmap.

⚙️ Integrations

  • Stoplight Studio - Free visual OpenAPI designer that uses Elements to preview your API descriptions on the fly.
  • Stoplight Platform - Collaborative API Design Platform for designing, developing and documenting APIs with hosted documentation powered by Elements.
  • LaravelPHP Elements - A simple API documentation package for Laravel using OpenAPI and Stoplight Elements.

🏁 Help Others Utilize Elements

If you're using Elements for an interesting use case, contact us for a case study. We'll add it to a list here. Spread the goodness 🎉

👏 Contributing

If you are interested in contributing to Elements itself, check out our contributing docs ⇗ and code of conduct ⇗ to get started.

🎉 Thanks

Elements is built on top of lots of excellent packages, and here are a few we'd like to say a special thanks to.

Check these projects out!

🌲 Sponsor Elements by Planting a Tree

If you would like to thank us for creating Elements, we ask that you buy the world a tree.

More Repositories

1

prism

Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
TypeScript
4,025
star
2

spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
TypeScript
2,265
star
3

studio

The modern editor for API Design and Technical Writing.
777
star
4

json-schema-viewer

A JSON Schema viewer React component
TypeScript
154
star
5

api-spec-converter

This package helps to convert between different API specifications (Postman, Swagger, RAML, StopLight).
JavaScript
136
star
6

spectral-action

GitHub Action wrapper for Spectral - a JSON/YAML/OpenAPI/AsyncAPI/etc linter with custom rule support.
JavaScript
82
star
7

desktop

The Stoplight desktop app + issues repository.
JavaScript
79
star
8

vscode-spectral

VS Code extension bringing the awesome Spectral JSON/YAML linter with OpenAPI/AsyncAPI support
TypeScript
65
star
9

spectral-owasp-ruleset

Improve the security of your API by detecting common vulnerabilities as defined by OWASP and enforced with Spectral.
TypeScript
47
star
10

spectral-rulesets

Keeping track of Spectral Rulesets in the wild, helping you build better, more consistent APIs, via OpenAPI, AsyncAPI, JSON Schema, etc.
41
star
11

json-ref-resolver

[Deprecated] Recursively resolve JSON pointers and remote authorities.
TypeScript
36
star
12

http-spec

Utilities to normalize OpenAPI v2 and v3 objects for the Stoplight ecosystem.
TypeScript
19
star
13

json

Useful functions when working with JSON.
TypeScript
17
star
14

studio-demo

13
star
15

ui-kit

Foundational React components for the Stoplight ecosystem.
CSS
13
star
16

formtron

JSON form builder for React.
TypeScript
13
star
17

jsonpath

JavaScript
12
star
18

yaml

Useful functions when working with YAML.
TypeScript
11
star
19

json-schema-tree

TypeScript
10
star
20

Public-APIs

A collection of public API descriptions.
10
star
21

scripts

Scripts to aid in testing, releasing, and linting.
TypeScript
8
star
22

json-schema-sampler

JavaScript
8
star
23

platform-docs

Documentation for the Stoplight Platform
7
star
24

studio-nightly

Nightly pre-releases of Studio Desktop https://github.com/stoplightio/studio
7
star
25

dev-portal

JavaScript
6
star
26

types

Common typings for the Stoplight ecosystem.
TypeScript
6
star
27

spectral-url-versioning

TypeScript
5
star
28

markdown

Useful functions when working with Markdown.
TypeScript
5
star
29

elements-starter-angular

Angular starter for stoplight elements components
HTML
5
star
30

sample-specs

4
star
31

ExampleChooserPrismProxy

proxy server that adds example-selection logic to an upstream Stoplight Prism mock server
Python
4
star
32

storybook-config

Shared storybook config for UI-Kit based project.
TypeScript
4
star
33

studio-templates

Project templates for Stoplight Studio.
4
star
34

style-guides-rulebook-series

4
star
35

stoplight-app

4
star
36

stoplight-cli-workflow

Stoplight CLI action
3
star
37

elements-starter-gatsby

Gatsby starter for Stoplight Elements components
JavaScript
3
star
38

js-coding-challenge

Stoplight Coding Challenge - HTTP request maker for OAS 2.0 specs
TypeScript
3
star
39

lifecycle

Event and disposable helpers.
TypeScript
3
star
40

elements-starter-react

[deprecated] Create React App example for older versions of Stoplight Elements. Use the new https://github.com/stoplightio/cra-template-elements
TypeScript
3
star
41

circleci-orbs

Stoplight's CircleCI Orbs
Shell
2
star
42

platform-v2-quickstart

2
star
43

path

TypeScript
2
star
44

json-ref-readers

Paired with a resolver package, readers handle the loading of $ref content. This repo contains some common readers for files, URLs, etc.
TypeScript
2
star
45

deference-openapi

1
star
46

webpack

Webpack helpers, built on top of webpack-chain.
TypeScript
1
star
47

spectral-documentation

Teach Spectral how to help improve the quality of your OpenAPI-based documentation.
TypeScript
1
star
48

spectral-workshop

1
star
49

docs-gen3

1
star
50

gatsby-starter-elements

Gatsby Starter for Stoplight Elements
JavaScript
1
star
51

docker-gitlab

From-source Docker image for Stoplight's fork of Gitlab on CentOS
Shell
1
star
52

code-of-conduct

Stoplight Community Code of Conduct
1
star
53

eslint-config

Shared Stoplight linting rules.
JavaScript
1
star
54

documentation

The markdown that powers the StopLight API Designer and Prism documentation.
1
star
55

.github

Template files for all repos
1
star
56

cra-template-elements

Elements Create React App Template
HTML
1
star
57

react-error-boundary

TypeScript
1
star
58

gatsby-starter-elements-dev-portal

Gatsby Starter for Stoplight Elements Dev Portal
JavaScript
1
star