styleguidist/react-styleguidist

Add a "View HTML" button

Open

#968 geöffnet am 7. Mai 2018

Auf GitHub ansehen
 (6 Kommentare) (9 Reaktionen) (0 zugewiesene Personen)TypeScript (1.416 Forks)github user discovery
help wanted

Repository-Metriken

Stars
 (11.091 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Many design systems can be used simply as a CSS library as well as React component library.

The styleguides document how to use the components both as React and as pure HTML with CSS classes. E.g.: https://designsystem.gov.au/components/buttons/

We are using Styleguidist and would like to add a "View HTML" button next the the "View Code" button that presents a read-only view of the currently rendered React component.

This would allow users to just download our CSS bundle and implement our components using which rendering technology is appropriate to them.

I haven't tried implementing this yet, but I would look at ways of accessing the innerHTML of a rendered Preview in Playground, though I realise this is a little quirky from a React perspective.

I would make the feature optional, and update slots to take a configuration object to determine whether to include the extra tab button and panel.

Happy to have a go at creating a pull request if you would be happy including this feature in React Styleguidist.

Contributor Guide