Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Implement interactive component documentation #128

Merged
merged 10 commits into from
Mar 4, 2025
Next Next commit
docs: Implement a interactive component documentation
  • Loading branch information
spuxx-dev committed Mar 3, 2025
commit 04bae75763906d9e2e02420127fc0ce9fc75430f
13 changes: 13 additions & 0 deletions apps/starlight/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -50,6 +50,19 @@ export default defineConfig({
},
],
},
{
label: 'solid',
items: [
{
label: 'Introduction',
slug: 'solid',
},
{
label: 'Components',
autogenerate: { directory: 'solid/components' },
},
],
},
],
}),
],
3 changes: 3 additions & 0 deletions apps/starlight/package.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,9 @@
"check": "astro check"
},
"devDependencies": {
"@spuxx/browser-utils": "workspace:@spuxx/browser-utils@*",
"@spuxx/js-utils": "workspace:@spuxx/js-utils@*",
"@spuxx/solid": "workspace:@spuxx/solid@*",
"@astrojs/check": "0.9.4",
"@astrojs/mdx": "4.0.8",
"@astrojs/solid-js": "5.0.4",
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { createSignal, type Component, type ComponentProps } from 'solid-js';
import { Dynamic } from 'solid-js/web';
import { Container, Divider, Heading } from '@spuxx/solid';

interface Props {
component: Component;
}

export const Interactive: Component<Props> = (props) => {
const { component } = props;
const [args] = createSignal<ComponentProps<typeof component>>({});

return (
<Container class="outlined">
<Heading level={2}>Live example</Heading>
<Divider />
<Dynamic component={props.component} {...args()} />
</Container>
);
};
Empty file.
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.