Lab for Svelte 268 items

Installation

Copy editable component source or import from the package.

Install editable source with the Lab CLI

The Lab CLI copies selected components, their CSS, and any shared source into your Svelte project. From your Svelte project, run:

npx @nomimono/lab-cli add button

The command requires a published CLI package or a locally installed CLI tarball. Run npx @nomimono/lab-cli list to see the available names. Use --registry <url> or set LAB_UI_REGISTRY to try a different registry.

Import the installed source:

<script lang="ts">
	import { Button } from '$lib/lab/button'
</script>

<Button>Save changes</Button>

Use button-clean for the Clean variant. The CLI skips existing files with identical contents and reports edited files before overwriting anything.

Add the package

For a Svelte 5 project, install the library from npm after release:

npm install @nomimono/lab-ui

Inside this monorepo, add it to the app's package.json, then install from the repository root:

{
	"dependencies": {
		"@nomimono/lab-ui": "workspace:*"
	}
}
bun install

Colors

Nothing else to load: each component carries its own CSS and colors. To match the app's theme, set the --lab-* variables; see Theming.

Import components

<script lang="ts">
	import { Button, Spinner } from '@nomimono/lab-ui'

	let saving = $state(false)
</script>

<Button loading={saving} onclick={() => (saving = true)}>Save changes</Button>
<Spinner label="Checking domain" />

Each component imports its own CSS, so nothing else needs loading. The Clean style comes from @nomimono/lab-ui/clean under the same names.

Requirements

  • Svelte 5.56.7 or newer in the 5.x series and SvelteKit, or Vite with the Svelte plugin.
  • A bundler that handles CSS imports from packages (SvelteKit and Vite do).