Skip to content
@hyzer-labs/ui

Components that ship behavior, not opinions

Accessible, headless components for Svelte 5. Style them yourself, or keep the reference theme.

What this library commits to

Accessibility first

Every component ships its WAI-ARIA pattern in full: roles, keyboard, focus. Restyling cannot turn it off.

Headless structure, overridable

The hz-* classes and data-* hooks hand you the styling; snippets hand you the markup. Both are documented API.

Theming is opt-in, one tier at a time

Tokens, the reference theme, your own overrides, or a generated sheet. Stop at any tier.

No bloat

Components carry structural CSS and nothing else. Svelte is the only peer dependency, and nothing extra reaches your production bundle.

Plain language, for you and your agents

A component's labels, error messages and empty states are part of its design. We write them short and skip the jargon.

What it weighs

What a visitor downloads, piece by piece
What you importDownload (gzipped)UncompressedWhat that includes
Every component, minified52.4 kB241 kBA real build of the whole library, carrying only the few icons the components draw. Import three components and you ship a fraction of this.
Component structural CSS5.9 kB40.1 kBLayout and behavior only. No colors or other visual styling.
Design tokens3.2 kB12.0 kBThe --hz-* custom properties, also called CSS variables.
Reference theme50.2 kB146 kBOne import for the shared base sheet plus a sheet per component. Import single component sheets instead and you pay less.
Reset1.3 kB2.4 kBOptional. Structural only.
Utilities1.7 kB6.8 kBHelper classes you import only if you want them.
Everything, together115 kB448 kB

Gzipped is what crosses the network. Uncompressed is what the browser holds once it unzips the file.

The first row is the ceiling for JavaScript, not for the total: you will always add at least the token sheet on top of it. Your bundler keeps only the components you import, so three components cost a fraction of that row. The reference theme works the same way. You can import one component sheet at a time instead of the whole thing. The token, reset and utility figures are exact, because you import each of those sheets whole.

1 dependency (build-time only), with svelte as the only peer dependency.

Install

Terminal
pnpm add @hyzer-labs/ui
css src/app.css
@import '@hyzer-labs/ui/tokens.css';
@import '@hyzer-labs/ui/theme';
@import '@hyzer-labs/ui/utilities.css'; /* optional */
  • Svelte 5.32 or newer.
  • Node 22.18 or newer. Only the hyzer CLI needs it.
  • TypeScript is optional. Types ship with the package.
  • SvelteKit is optional. The library imports nothing from Kit.

Then import a component and render it. The code below is a whole file. Beside it is that same file, rendered with the reference theme.

<script>
	import { Card, Badge, Button } from '@hyzer-labs/ui';
</script>

<Card padding="sm" class="conditions">
	<strong>Maple Hill</strong>
	<span class="muted">18 holes · open at dawn</span>
	<Badge intent="success">Greens fast</Badge>
	<Badge intent="warning">Wind picking up</Badge>
	{#snippet actions()}
		<Button size="sm">Book a tee time</Button>
	{/snippet}
</Card>

<style>
	/* The class prop lands on the component root, but Svelte scopes
	   selectors to elements in your own markup, so target it with
	   :global. */
	:global(.conditions) {
		background: var(--hz-color-surface-muted);
		max-inline-size: 24rem;
	}

	.muted {
		display: block;
		color: var(--hz-color-text-muted);
		margin-block-end: 0.75rem;
	}
</style>
Maple Hill 18 holes · open at dawn Greens fast Wind picking up

Browse the docs

Getting Started

Install the package, import a component, and theme it in three steps.

Components

Every component, with its props, theme hooks and accessibility notes.

Theming

The layer model, and how far you can push it without forking the library.

Patterns

Full pages built from the library: homepage, product listing, checkout form, and more.

Philosophy

What every component commits to, and why.

Agents

Point a coding agent at this library and keep its output correct.