Skip to content

Installation

Install

sh
npm install @popovandrii/ui-elements

Import the styles

The components are unstyled until you load a stylesheet. Import the base component styles (ships a sensible light/dark default), and optionally an explicit theme:

ts
import '@popovandrii/ui-elements/style.css'

// Optional explicit themes (set <html data-theme="dark">, etc.)
// import '@popovandrii/ui-elements/theme-dark.css'
// import '@popovandrii/ui-elements/theme-light-neon.css'

See Theming for the four built-in themes, the OS-dark default, and runtime switching.

Import and initialize a component

ts
import { SpinBox } from '@popovandrii/ui-elements'

const spin = new SpinBox()

// Later, when the markup goes away (SPA route change):
spin.destroy()

That's it — render the matching markup (see each component page) and the manager does the rest.