Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

next-parade

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-parade

Lightweight UI component stories and documentation showcase for [Next.js](https://nextjs.org/). Is Storybook and Docz too bloated for you? I'm working on a simple alternative.

  • 0.0.4
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

🚩 Parade!

Lightweight UI component stories and documentation showcase for Next.js.
Is Storybook and Docz too bloated for you? I'm working on a simple alternative.

⚠️ Pre-alpha: This is a proof-of-concept.

Usage

npm install next-parade
yarn add next-parade

Configure and render it on the page:

// ./pages/index.js
import parade from 'next-parade'
import withStaticProps from 'next-parade/props'

const context = require.context('../src/components', true, /\.js/) // relative path and regex
export default parade(context)
export const getStaticProps = withStaticProps(context, 'src/components') // context and "absolute" path

By convention React Component should be the default export from a file.

Advanced example

// ./pages/showcase.tsx
import { GetStaticProps } from 'next'
import parade from 'next-parade'
import withStaticProps from 'next-parade/props'
import styles from '../styles/Home.module.css'

const context = require.context('../components', true, /\/[A-Z]\w\.tsx/)
const ComponentsParade = parade(context)

const Home = ({ ...props }) => (
  <div className={styles.container}>
    <ComponentsParade {...props} title="Styleguide" style={{ maxWidth: '600px' }} />
  </div>
)

export default Home

export const getStaticProps: GetStaticProps = async (context) => {
  const output = withStaticProps(context, 'components')
  return {
    ...output,
    props: {
      ...output.props,
      // additional props and overrides
    },
  }
}

Development

npm run dev
yarn dev

Open http://localhost:3000 with your browser to see the result.

This project is using itself for documentation.

Roadmap

  • license info (MIT? 0BSD?)
  • CI
  • editable props
  • parse markdown
  • order of elements (sort)
  • add "last build" to website

FAQs

Package last updated on 30 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc