Skip to content
sdocs

sdocs

A lightweight documentation tool for Svelte 5 components.

npm install -D sdocs

One small file per component

Drop a .sdoc file next to a component and it appears in an interactive explorer: live preview, controls generated from args, and a prop table extracted from the component itself. No stories API to learn — a doc file is a Svelte file, with snippets for every state you want to show.

<script lang="ts">
	import Button from './Button.svelte';
</script>

[SHOWCASE title="@components/Button" description="A flexible button."]

	[component component={Button} args={{ label: 'Click me' }}]
		<Button {...args} />
	[/COMPONENT]

	[example title="Sizes"]
		<Button label="Small" size="sm" />
		<Button label="Large" size="lg" />
	[/EXAMPLE]

[/SHOWCASE]

The three faces of sdocs

This site is built with sdocs itself — the Demo section showcases the site's own components, every guide you're reading is a [DOC] entity, and this landing page is a [PAGE].