ni / nimble

The NI Nimble Design System
https://nimble.ni.dev
MIT License
29 stars 9 forks source link

Set up stackblitz or codepen template with Nimble #325

Open jattasNI opened 2 years ago

jattasNI commented 2 years ago

😯 Problem to Solve

I wanted to quickly play with a Nimble component configuration that wasn't available from Storybook (in my case, I wanted to make a demo for someone to show how to use an arbitrary image as a button icon). Ideally I could click a button and be launched into a live editor environment that imports all the right Nimble dependencies, shows a code sample with some nimble components, and renders the components in a sandbox page.

💁 Proposed Solution

Codepen and [Stackblitz]() are two sites that offer this functionality. I'd love to see a link from the top level README and Storybook that takes you to one of these with everything Nimble needs already pre-populated.

rajsite commented 2 years ago

Created a nimble angular stackblitz here: https://stackblitz.com/edit/nimble-angular-issue-template Anything else we want to add or test in it? If nothing we should add it to the issue template and ask clients to include minimal reproductions.

Some issues currently:

rajsite commented 2 years ago

I think all of the following applies only to stackblitz with their web containers feature which is beta and not supported on safari (?).

Looks like we can create a url to import from github with stackblitz: https://developer.stackblitz.com/docs/platform/importing-projects/#import-from-github

jattasNI commented 2 years ago

Awesome!

Anything else we want to add or test in it

A couple suggestions, none of which is a showstopper:

just need to go public

Easy, right? :-D I added a note to #290 to mention this as another rationale for open sourcing.

rajsite commented 2 years ago

Another fiddle alternative is codesandbox: Pros:

rajsite commented 11 months ago

Stackblitz added a new webcontainer api so you can have more control / fully embed the environment on a page. Could make the show code button in storybook bring up a full running example 🤔