sveltelean
Version v0.18.0 Get started

Let the browser do the work.

Native elements first.

Shared listeners, not copies.

Zero bytes where the browser can.

Accessible primitives and a data table for Svelte 5.

Browse components Get started

Real components. Try them.

Every tile is the shipped primitive with its stylesheet. Open the code: it is all you write.

  • Buttons

  • Show status

    Paid Due soon Overdue Draft

    Invoices sync every hour

    The last run finished at 09:00.

  • Copy a link

  • Search and choose

  • Pick a range

  • Open a menu

  • Format text

  • Settings

    Theme
  • Confirm a delete

    Delete this project?

    Its history is removed. This cannot be undone.

  • Switch views

    Four open tasks, two due this week.
  • Notify

    1. Show progress

      64% 100%
    2. Verify a code

    3. Filter by price

      Price, USD

      200 – 800

    4. Rate

      How was the call?

    Weights are production JavaScript, brotli, per primitive. Zero means the browser does the work. All primitives

    A few lines. No components.

    No component imports, no wrappers. The Vite plugin reads the attributes and adds only the behaviors a page uses.

    share.svelte
    <script lang="ts">
    	import '@svelte-lean/styles/button.css';
    	import '@svelte-lean/styles/dialog.css';
    	import '@svelte-lean/styles/hint.css';
    
    	let { url }: { url: string } = $props();
    </script>
    
    <button data-slean="button" commandfor="share" command="show-modal">
    	Share
    </button>
    
    <dialog id="share" data-slean="dialog" closedby="any" aria-labelledby="share-title">
    	<header>
    		<h2 id="share-title">Share this page</h2>
    		<p><code>{url}</code></p>
    	</header>
    	<footer>
    		<button data-slean="button" data-slean-copy={url}
    			data-slean-hint="Copy link" data-slean-hint-copied="Copied">
    			Copy link
    		</button>
    		<button data-slean="button" data-variant="text" commandfor="share"
    			command="close">Done</button>
    	</footer>
    </dialog>
    Renders

    Share this page

    https://svelte-lean.dev/primitives

    Lines
    23
    Imports
    3 stylesheets
    Components
    0
    • Dialog command="show-modal" opens it 0 B
    • Button a stylesheet on a <button> 0 B
    • Copy data-slean-copy, shared listener 1.3 kB
    • Tooltip data-slean-hint, one bubble per page 2.7 kB

    A real screen, built from primitives.

    Harbor Studio Team

    2 seats free.

    Invitations take a seat once they are accepted.

    Actions
    Amara Okafor
    Engineering
    Owner
    Active
    Jonas Lindqvist
    Design
    Admin
    Active
    Mei Tanaka
    Operations
    Member
    Away
    Rafael Duarte
    Growth
    Member
    Active
    Selin Aydın
    Engineering
    Admin
    Active
    Noah Brenner
    Design
    Member
    Away
    Priya Raman
    Operations
    Member
    Active
    Elias Moreau
    Growth
    Member
    Active
    Hana Kowalska
    Engineering
    Admin
    Away
    Ömer Say
    Design
    Member
    Active
    10 members · 2 pending invitations A demo screen: nothing is saved and there is no server.

    Invite member

    They get an email with a link to join Harbor Studio.

    Remove member?

    They lose access to every Harbor Studio project.

    Fifty thousand rows. Still a table.

    Every row is a real row in the document. Off-screen rows are skipped by the browser, and the rest mount between frames.

    Rows

    The table mounts when this section comes into view.

    members.svelte
    <DataTable
    	{data}
    	{columns}
    	getRowId={(row) => row.id}
    	layout="grid"
    	progressive
    	pagination={false}
    	searchable
    	stickyHeader
    	height="30rem"
    />

    Timings are taken in your browser as you watch, not published results. Grid layout and progressive mounting The table: grouping, editing, pivot, export

    Ten thousand tabs. No new listeners.

    Behavior is registered once per page, not copied into every instance. Mount more tabs and read the document again.

    Tabs roots
    1
    Mount, this browser
    …
    Listeners on elements
    …
    Listeners on the document
    Root 1, a panel.

    Measured against Bits UI

    Same UI, production builds, headless Chrome.

    Dialog, JavaScript

    Svelte Lean 0 B
    Bits UI 12.4 kB

    Menu, JavaScript 14.2× smaller

    Svelte Lean 1.9 kB
    Bits UI 27.1 kB

    Tabs, JavaScript 3.7× smaller

    Svelte Lean 1.5 kB
    Bits UI 5.4 kB

    Time to mount, a thousand tabs 6.3× faster

    Svelte Lean 35.1 ms
    Bits UI 220.8 ms

    JavaScript heap, a thousand tabs 21.5× smaller

    Svelte Lean 2.3 MB
    Bits UI 48.9 MB

    Median of nine runs; heap after garbage collection. Open the proof page

    Most of it weighs nothing.

    27 of 50 primitives are plain HTML with a stylesheet: they add no JavaScript.

    Production build, brotli, including the shared kernel each behavior needs. All measurements

    @svelte-lean/query · v0.2.0

    Svelte Lean Query

    Server state for Svelte 5: endpoints defined once, a cache keyed by params, invalidation by typed tags and the loading states a screen needs, built on runes.

    Read the documentation
    • Queries
    • Mutations
    • Cache
    • Invalidation
    • Polling
    • Realtime
    npm install @svelte-lean/query

    The bracket is the browser. The square is Svelte Lean.

    Start with the HTML you already know.

    npm install @svelte-lean/primitives