Quick start

Noph UI requires Svelte 5.40 or newer. It works inside SvelteKit or in a plain Vite + Svelte project alike, SvelteKit is not required.

Install

Install Noph UI components using npm and node.

npm install noph-ui

Theming

The quickest way to get started with Noph UI is by using the default theme. You can import it into your +layout.svelte file as shown below:

import 'noph-ui/defaultTheme'

To apply both the theme's background color and text color to the entire app, you can target the <body> element directly in your app.css file like this:

body {
	background-color: var(--np-color-background);
	color: var(--np-color-on-background);
}

This will ensure that the background and text color for the entire app are set to match the theme's color scheme.

Theming goes further: generate a theme from your own source color, browse every color, shape and motion token, and switch themes while the app is running.

Dark and light color schemes

The theme includes color schemes for both dark and light modes. The selected theme is automatically determined based on the user's system settings. Alternatively, you can enforce a specific theme by setting the data-theme attribute in your app.html. Valid values for this attribute are dark and light.

<html lang="en" data-theme="dark">

Typography

Define a font family in your app.css. You can load the default 'Roboto' font, for example, from fonts.google.com.

body {
	font-family: 'Roboto';
	...
}

Put it together

A minimal SvelteKit app with the pieces above wired up.

src/routes/+layout.svelte

<script>
	import 'noph-ui/defaultTheme'
	import './app.css'

	let { children } = $props()
</script>

{@render children()}

app.css is the file from the Theming section above, the one that sets background-color and color on body.

src/routes/+page.svelte

<script>
	import { Button } from 'noph-ui'
</script>

<h1>Hello Noph UI</h1>
<Button variant="filled">Get started</Button>

Both files render on the server without extra setup. SvelteKit server renders every route by default, and Noph UI's components never reach for window or other browser only APIs during that render. Noph UI itself does not depend on SvelteKit, only on Svelte, so a plain Vite + Svelte project renders the same markup, just on the client instead of the server. An adapter that produces a static or client only build also falls back to client rendering.

What's next

  • Theming goes deeper: generate a color scheme from your own source color, and browse every color, shape and motion token Noph UI exposes.
  • Icons covers the two ways to bring icons into a project, the Icon component and inline SVGs.
  • Every component has its own page with usage examples, a full API reference and a Theming section. Find them in the navigation on the left, starting with Buttons.