carbon-components-svelte icon indicating copy to clipboard operation
carbon-components-svelte copied to clipboard

[WIP] Component Playground

Open NyxCode opened this issue 3 years ago • 2 comments

Right now, the docs contain a separate example for every prop. Vuetify, for example, has a nice playground where one can directly interact with the components in the documentation.

What I've got so far looks like this:

img

The definition of this playground in Checkbox.svx looks like this:

<Playground
    component={Checkbox}
    props={{
        labelText: {
            component: "TextInput",
            props: { value: "Label text", labelText: "Label" }
        },
        checked: {
            component: "Checkbox",
            props: { labelText: "Checked" }
        },
        indeterminate: {
            component: "Checkbox",
            props: { labelText: "Indeterminate" }
        },
        hideLabel: {
            component: "Checkbox",
            props: { labelText: "Hide label" }
        },
        disabled: {
            component: "Checkbox",
            props: { labelText: "Disabled" }
        },
        skeleton: {
            component: "Checkbox",
            props: { labelText: "Skeleton" }
        },
    }} />

Feedback would be appreciated!

NyxCode avatar May 04 '21 15:05 NyxCode

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/carbon-svelte/carbon-components-svelte/C6X2A8XSurrioWZ12RgUtW6i32QY
✅ Preview: https://carbon-compone-git-fork-nyxcode-playground-carbon-cba1c9.vercel.app

vercel[bot] avatar May 04 '21 15:05 vercel[bot]

Demo: https://carbon-compone-git-fork-nyxcode-playground-carbon-cba1c9.vercel.app/components/Checkbox

NyxCode avatar May 04 '21 15:05 NyxCode