Skip to content

Share styleguidist components between applications #2161

Open
@BennyHudson

Description

@BennyHudson

Hello,

We currently have a heavily customised Styleguidist project running using Lerna supporting ~500 components. We're looking at breaking this down a bit so that we can have multiple projects with fewer components, but we'd like to retain the look and feel between these applications.

I was just wondering if there's any way of consuming published components as part of the Styleguide config components object? Currently it looks as though you can only provide a relative path to components, but we would like to be able to publish a package and then import { ThemeProvider } from 'package-name' and pass this in to the components object.

Basically something like:

import { ThemeProvider } from 'wherever'
import { StyleguideRenderer } from 'this-package'

export default {
  /**
   * Generic Setup
   */
  skipComponentsWithoutExample: true,
  pagePerSection: true,
  template: {
    favicon: 'favicon.ico',
    lang: 'en',
  },
  styleguideComponents: {
    Wrapper: ThemeProvider,
    StyleGuideRenderer: StyleguideRenderer,
  },
...

Is this possible? Not sure if something like this - https://react-styleguidist.js.org/docs/cookbook#how-to-change-styles-of-a-style-guide - would already work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions