Getting started
This guide takes you from an empty project to a rendered Lovelace component.
Requirements
- React 19 and React DOM 19. The peer dependency range is
^19.0.0and earlier versions are not supported. - A bundler or dev server that can import plain
.cssfiles. Vite, Next.js, and webpack withcss-loaderall qualify.
1. Install the package
@ada-cx/lovelace is live on npm. Install the latest version. Before GA, any release can change or remove a component’s props. Read the release notes before you upgrade.
2. Import both stylesheets
Import both stylesheets once, at your app entry:
Both imports are required:
tokens.cssdefines the--lovelace-*custom properties inside@layer lovelace.tokens. It carries every design value: colors, fonts, spacing, radii.style.cssholds all component styles in one file. Those styles only reference the custom properties throughvar().
A JS-only import renders unstyled components. The library build extracts all component CSS to style.css, so importing components without the stylesheets produces bare, unthemed markup.
3. Wrap your UI in LovelaceProvider
LovelaceProvider is the prescribed entry point for consuming Lovelace.
The provider does three jobs:
- It resolves the color scheme (
light,dark, orauto) and stampsdata-themeon its wrapper.autofollows the OS preference live. - It applies token overrides from its
overrideprop. - It keeps React Aria overlay portals (Dialog, Sheet, Tooltip) inside the theme boundary.
Components render without the provider, and data-theme defaults to light. Without the provider you own theme switching and portal scoping yourself.
4. Verify the result
Run your dev server. You should see a filled accent button labeled “Send”. Hover and keyboard focus states style themselves through data-* attributes.
If the button renders as unstyled text, one or both stylesheet imports are missing. Check step 2.
Next steps
- Try your brand on live components in the theme playground.
- Rebrand the components with token overrides.
- Browse the component catalog and its live gallery.
- Wire the components to a live conversation in Build a custom chat UI.