carbon-components-svelte
carbon-components-svelte copied to clipboard
[WIP] Component Playground
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:
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!
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
Demo: https://carbon-compone-git-fork-nyxcode-playground-carbon-cba1c9.vercel.app/components/Checkbox