carbon-design-system/sveld is a TypeScript project with 454 stars in the Frontend space. Generate TypeScript definitions and component documentation for your Svelte components
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
sveld generates TypeScript definitions and component documentation (JSON and Markdown) for Svelte component libraries. It statically analyzes props, events, slots, snippets, context, module exports, and rest props, and reads JSDoc where inference isn't enough.
The generated .d.ts files give consumers autocomplete and type checking through the Svelte Language Server and TypeScript, with little effort from the library author. Carbon Components Svelte uses sveld to generate its component types and API metadata.
sveld supports Svelte 3, Svelte 4, Svelte 5 without runes (export let, <slot>, $$restProps), and Svelte 5 runes ($props(), $bindable(), {@render}, callback props).
When to use sveld
If your library is built with SvelteKit's svelte-package, it already emits .d.ts files through svelte2tsx; start there.
sveld is for:
JavaScript-first libraries. Components written in plain JavaScript with JSDoc, where you want full editor types without converting to lang="ts".
Docs from the same source as the types. JSON and Markdown API docs, generated in the same run.
API drift checks.--check diffs the component API against a committed snapshot and fails CI on breaking changes.
Richer types from JSDoc.@typedef, @callback, @slot, @event, and context types that plain inference can't produce.
lang="ts" components work too: sveld keeps their type annotations as written.
Install
npm i -D sveld
# or: pnpm i -D sveld / bun i -D sveld / yarn add -D sveld
Quick start
sveld reads the "svelte" field of your package.json as the entry point: the file that re-exports your components.
{
"svelte": "./src/index.js"
}
CLI
npx sveld # writes types/*.d.ts
npx sveld --json --markdown # also writes COMPONENT_API.json and COMPONENT_INDEX.md
Run npx sveld --help for every flag. Options can also live in a sveld.config.js:
document is the same component API document json: true writes, so you can render your own formats from it. See Options for everything sveld() accepts and returns.
Example
Given this component:
<!-- Button.svelte -->
<script>
export let type = "button";
export let primary = false;
</script>
<button {...$$restProps} {type} class:primary on:click>
<slot>Click me</slot>
</button>
sveld infers prop types and defaults, the forwarded click event, the default slot, and the rest props spread onto <button>:
The default slot is also typed as a children snippet prop for Svelte 5 consumers, and the data-* index signature lets callers pass data attributes through $$restProps.
Add JSDoc to tighten types and add descriptions:
<script>
/** @type {"button" | "submit" | "reset"} */
export let type = "button";
/**
* Set to `true` to use the primary variant
*/
export let primary = false;
</script>
type $Props = {
/**
* @default "button"
*/
type?: "button" | "submit" | "reset";
/**
* Set to `true` to use the primary variant
* @default false
*/
primary?: boolean;
children?: (this: void) => void;
[key: `data-${string}`]: unknown;
};
The runes version (let { type = "button", primary = false, children, ...rest } = $props(), spreading rest and rendering children) produces the same $Props. It has no click event, since runes components take onclick as a prop through rest.
The .d.ts extends SvelteComponentTyped by default, which works for consumers on Svelte 3, 4, and 5. Set typesOptions.format: "component" (--types-format=component) to emit the Svelte 5 Component type instead. See Output.
JSON and Markdown
npx sveld --markdown documents the same component in COMPONENT_INDEX.md:
## `Button`
### Props
| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
| :- | :- | :- | :- | :- | :- | :- | :- |
| type | No | <code>let</code> | No | -- | <code>"button" | "submit" | "reset"</code> | <code>"button"</code> | -- |
| primary | No | <code>let</code> | No | -- | <code>boolean</code> | <code>false</code> | Set to `true` to use the primary variant |
### Slots
| Slot name | Default | Props | Fallback | Description |
| :- | :- | :- | :- | :- |
| -- | Yes | <code>Record<string, never> </code> | <code>Click me</code> | -- |
### Events
| Event name | Type | Detail | Description |
| :- | :- | :- | :- |
| click | forwarded | -- | -- |
npx sveld --json writes the same data to COMPONENT_API.json, validated by a JSON Schema that ships with the package. An excerpt of the prop entry:
Commit COMPONENT_API.json, then gate pull requests on API changes and inference gaps:
npx sveld --check # exit 3 on a breaking API change against the snapshot
npx sveld --strict # exit 4 when a prop fell back to `any`, a tag was dropped, ...
How active is development on carbon-design-system/sveld?
The most recent commit recorded on carbon-design-system/sveld was 12 days ago, based on the GitHub push timestamp. The repository has 23 forks — one of the better signals of community interest.
How many stars does carbon-design-system/sveld have?
carbon-design-system/sveld has 454 GitHub stars — refresh the page for the live number, or check github.com/carbon-design-system/sveld. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What else is in the Frontend space?
carbon-design-system/sveld is tracked by TopGit under the Frontend category, alongside 6 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What language is carbon-design-system/sveld written in?
carbon-design-system/sveld is written primarily in TypeScript. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is carbon-design-system/sveld associated with?
GitHub's repository topics for carbon-design-system/sveld: "docgen", "documentation", "jsdoc", "svelte", "svelte-component", "typescript-definitions". TopGit's editorial category is Frontend.
Where do I read more about carbon-design-system/sveld?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/carbon-design-system/sveld is the definitive source.
Why is carbon-design-system/sveld categorized under Frontend?
TopGit places carbon-design-system/sveld in the Frontend category based on its GitHub topics and description (tagged: "docgen", "documentation", "jsdoc"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Curious whether sveld is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about sveld.