sveltelean
Version v0.18.0
  • Primitives: 50 accessible primitives. 27 are native markup with no runtime; the others register one shared behavior per page, whatever the number of instances.
  • Table: <DataTable /> renders a native <table> and grows into a data grid through props and separate entry points.
  • Styles: optional CSS, design tokens plus one file per primitive.

Install

npm install @svelte-lean/primitives @svelte-lean/styles
npm install --save-dev @svelte-lean/vite

Add the plugin. It finds the data-slean markers in your files at build time and imports the behaviors they need, nothing else.

vite.config.ts
// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import { svelteLean } from '@svelte-lean/vite';
import { defineConfig } from 'vite';

export default defineConfig({
	plugins: [svelteLean(), sveltekit()]
});

First component

A button with a hint that opens a modal dialog. Hover or focus the button, then press it.

Hint and dialog

Invite a member

Code
<script lang="ts">
	import '@svelte-lean/styles/button.css';
	import '@svelte-lean/styles/dialog.css';
	import '@svelte-lean/styles/field.css';
	import '@svelte-lean/styles/hint.css';
	import '@svelte-lean/styles/input.css';
</script>

<button
	type="button"
	data-slean="button"
	data-slean-hint="Invite someone to this project"
	commandfor="invite"
	command="show-modal"
>
	Invite
</button>

<dialog id="invite" data-slean="dialog" aria-labelledby="invite-title">
	<header>
		<h2 id="invite-title">Invite a member</h2>
	</header>
	<div data-slean="field">
		<label for="invite-email" data-slean-part="label">Email</label>
		<input id="invite-email" type="email" name="email" data-slean="input" />
	</div>
	<footer>
		<button type="button" data-slean="button" commandfor="invite" command="close">Done</button>
	</footer>
</dialog>
PartTierWho does the workBehavior JavaScript
Dialog0The browser: <dialog> and command give the top layer, Escape and focus return.0 B brotli
Hint1One shared behavior, added by the plugin because the file contains data-slean-hint.2687 B brotli

No component imports, no wrappers, no ids generated at hydration: the markup is the API, and it renders the same on the server.

What a page ships

  • Native primitives only (button, dialog, popover): 0 B of Svelte Lean JavaScript in the production fixture.
  • A page with tabs: the tabs behavior and the shared kernel, 1839 B brotli, for one tab list or a thousand.

How this is shipped and verified: Distribution and Performance.

Packages

PackageRole
@svelte-lean/primitivesContracts and types for all 50 primitives; 17 Tier 1 and 6 Tier 2 behaviors as side-effect register modules
@svelte-lean/table<DataTable />, createTable(), optional modules
@svelte-lean/stylesOptional CSS: tokens, base, one file per primitive
@svelte-lean/viteBuild-time behavior discovery, manifest, build report
@svelte-lean/coreBehavior registry, shared event router, DOM and keyboard helpers, diagnostics

Version 0.18.0, a preview; the release stage is recorded in docs/release.md. Not yet available: Firefox and WebKit test runs, screen-reader tests, a command-line tool. Every public claim and its evidence: claim registry.

Next steps