Skip to Content

Getting started

What Nocturne is, and how to add it to an app.

Nocturne is a dark-first design system for dense tool interfaces. @aiviarium/nocturne is its SolidJS component library.

The library has typed wrappers over the nc-* classes. It adds layout, overlay, data, form and phone components, and a collaborative rich text editor. The stylesheets in src/styles/ are the design system itself. tokens.css holds the tokens and bundle.css the base classes.

Buttons and inputs
Open the example ↗

Install

The package is not published to a registry yet. Add it from a Git checkout or a packed tarball.

bun add solid-js
bun add @aiviarium/nocturne@file:../nocturne   # or a tarball from `bun pm pack`

solid-js 1.9 is a peer dependency. The package contains TypeScript sources, and exports points at src/index.ts. Build it with a bundler that compiles Solid JSX, such as Vite with vite-plugin-solid.

Import

import "@aiviarium/nocturne/styles/index.css"
import { Button, DataTable, Composer } from "@aiviarium/nocturne"

styles/index.css loads tokens.css, bundle.css and extra.css in cascade layers. The order is reset, tokens, components, then app for your own CSS. Import each file yourself if you manage layers another way.

Then put class="nc" and a data-theme on the root of the app. See Theming.

What is in it

AreaParts
LayoutAppShell with sidebar, top bar, status bar and phone drawer. Frame with a TabStrip header. ViewLayout, ViewHeader, Panel, Split, SplitGroup and Dialog
Lists and dataRowList and ListRow, DataTable, DataList, Board, List
FormsTextField, TextArea, Select, Switch, NumberField, Slider, SchemaForm and the field kinds
DisplayBadge, State, Avatar, Callout, Icon, Stat, StatCard, Widget, WidgetGrid
TextRichTextEditor, Composer, CodeBlock, DiffView
FiltersFilterBar, QueryBuilder
PhoneNavigation stacks, tab bars, sheets, inset lists and the phone scale

LinkProvider sends NavItem and Button links through your router. Component roots have a stable data-part attribute. Props are documented with TSDoc.

The gallery shows every example, with a theme switch and the six accent presets. Run it with bun run gallery on 127.0.0.1:4800, or open the copy built with this site ↗. The examples on these pages are the same examples, shown in frames.

Commands

CommandWhat it does
bun installInstalls the dependencies
bun run galleryRuns the gallery on 127.0.0.1:4800
bun run gallery:buildBuilds the gallery into gallery/dist
bun testRuns the behaviour tests with happy-dom, which has no layout, caret or IME
bun run typecheckRuns tsc --noEmit
bun run lintRuns Biome
bun run lint:tokens [path ...]Fails on literal colours, radii or font sizes in .css, .tsx and .ts files
bun run gen:iconsWrites src/components/icon-data.ts from icons/*.svg

lint:tokens checks src, gallery and examples by default. A line with lint-tokens-ignore is skipped. Apps can run it on their own folders.

Edit on GitHub

Last updated on

On this page