Overview
Purpose
Svelte 5 components repeat the same few patterns: accepting a class, spreading extra attributes, declaring children snippets, and offering boolean variant props such as small or primary. This package names those patterns once so components stay consistent and type-safe.
It is not a component framework. There is no styling, theming, or state management, and the only component is RenderSnippet.
Installation
bun add @atom-forge/svelte-helpers
Svelte ^5.0.0 is a peer dependency.
What is exported
| Group |
Exports |
Kind |
| Prop types |
ClassProp, AnyProp, ChildrenProp, ChildrenPropOptional |
types only |
| Type utilities |
XOR, AtLeastOne |
types only |
| Helpers |
variantMap, debounce, debounceAsync, as |
runtime |
| Component |
RenderSnippet |
runtime |
Import runtime values normally and types with import type:
import { debounce, variantMap } from "@atom-forge/svelte-helpers";
import type { ClassProp, XOR } from "@atom-forge/svelte-helpers";
Overview
Purpose
Svelte 5 components repeat the same few patterns: accepting a
class, spreading extra attributes, declaringchildrensnippets, and offering boolean variant props such assmallorprimary. This package names those patterns once so components stay consistent and type-safe.It is not a component framework. There is no styling, theming, or state management, and the only component is
RenderSnippet.Installation
Svelte
^5.0.0is a peer dependency.What is exported
ClassProp,AnyProp,ChildrenProp,ChildrenPropOptionalXOR,AtLeastOnevariantMap,debounce,debounceAsync,asRenderSnippetImport runtime values normally and types with
import type:import { debounce, variantMap } from "@atom-forge/svelte-helpers"; import type { ClassProp, XOR } from "@atom-forge/svelte-helpers";