github styleguidist/react-styleguidist v7.1.0

latest releases: v13.1.2, v13.1.1, v13.1.0...
5 years ago

👋 Support Styleguidist on Open Collective 👋

New features

Updated page per section option

New options that you can use in sections:

  • sectionDepth — Number of subsections with single pages, only available with pagePerSection is enabled.
  • exampleMode — Initial state of the code example tab
  • usageMode — Initial state of the props and methods tab
{
  name: 'UI Components',	       name: 'UI Components',
  content: 'docs/ui.md',	       content: 'docs/ui.md',
  components: 'lib/components/ui/*.js',
+  sectionDepth: 2,
+  exampleMode: 'expand', // 'hide' | 'collapse' | 'expand'
+  usageMode: 'expand' // 'hide' | 'collapse' | 'expand'
}

showCode and showUsage options are deprecated and will be removed in the next major release.

(#1040 by @rafaesc)

Command-line argument to open a browser on start

Run npx styleguidist server --open to run Styleguidist dev server and open it in the default browser.

(#932 by @rubenmoya)

Version number in sidebar

You can show a version number in the sidebar of your style guide (disabled by default) like this:

const { version } = require('./package')
module.exports = {
	components: 'src/components/**/[A-Z]*.js',
	version
}

(#1043 by @eemeli)

Glob patterns in arrays and functions in components option

components option (global one or inside a section) can now accept an array of glob pattern strings, or a function returning glob pattern strings:

{
  components: [
    'src/components/forms/**/[A-Z]*.js',
    'src/components/typography/**/[A-Z]*.js'
  ]
}

(#1033 by @wkillerud)

Bug fixes

  • Better Flow union props rendering (#1035)
  • Inherit font and font-weight from body
  • Isolate CodeMirror styles (#1049), closes #1047
  • Lock react-docgen version to exactly 3.0.0-beta12 (#1041)
  • Remove support of deprecated React root container ID (app) (#1045)

Don't miss a new react-styleguidist release

NewReleases is sending notifications on new releases.