Quick start
Noph UI requires Svelte 5.56.5 or newer. It works with SvelteKit or with a plain Vite + Svelte project.
Install
Install Noph UI with npm.
npm install noph-uiTheming
The quickest way to start is the default theme. Import it in your +layout.svelte:
import 'noph-ui/defaultTheme'To use the theme's background and text color in the whole app, set them on <body> in your app.css:
body {
background-color: var(--np-color-background);
color: var(--np-color-on-background);
}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 has a dark and a light color scheme. By default it follows the user's system setting. To
force one, set the data-theme attribute in your app.html to dark or light.
<html lang="en" data-theme="dark">Typography
Set a font family in your app.css. For example, load the default 'Roboto' font from
fonts.google.com.
body {
font-family: 'Roboto';
...
}Icons
Buttons, fields and navigation take icons where Material 3 uses them. The Icon component draws them from the Material Symbols font. The font is not part of the package, so load it
in your app.html. Otherwise you see the icon name instead of the icon. Request the
icons you use from Google Fonts, here search and home:
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined&icon_names=search,home"
/>Icons covers the font settings, and how to pass your own SVG instead.
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>