Installation

Framework Guide

Lever UI runs on Solid 2. Use a Solid 2 toolchain, such as Vite with @solidjs/vite-plugin, and set jsxImportSource to @solidjs/web in tsconfig.json. Rendering on the server? See the server rendering guide. New to Solid 2? Read Using Solid 2.

Installation

Install the package

Code
pnpm add @leverui/components@next solid-js @solidjs/web
pnpm add -D @solidjs/vite-plugin

Keep @next until the first stable release. With npm or Yarn: npm install @leverui/components@next solid-js @solidjs/web. Requires solid-js and @solidjs/web 2.0.0 or later.

Import the stylesheet

Import it once in your app entry, before your own theme stylesheet.

Code
import '@leverui/components/styles.css';
import './theme.css';

theme.css can override the --leverui-* variables. See the theme guide.

Render a component

Import components from the package root.

Code
import { Button } from '@leverui/components';

/** Render an action using the default stylesheet. */
function App() {
  return <Button colorPalette="blue">Continue</Button>;
}

Update TypeScript settings

Set jsx to preserve and jsxImportSource to @solidjs/web. The types pass strict checks without skipLibCheck. With skipLibCheck off, add ES2023 or later to lib.

Code
{
  "compilerOptions": {
    "jsx": "preserve",
    "jsxImportSource": "@solidjs/web",
    "lib": ["ES2023", "DOM", "DOM.Iterable"]
  }
}

Learn

Start with Button, Field, and Input. For labels, validation, keyboard, and focus, read the accessibility guide.