Install
Set up Surflane in a React 19 app. The commands and files follow the framework and options you choose.
Your setup
The steps below follow these choices, and the page address keeps them.
1. Install
The three Surflane packages ship with one version. Base UI is a peer, and everything needs React 19.
2. Add the files
Replace each file, or create it where it is missing.
@surflane/ui/all.css loads every Surflane stylesheet. Drop the template's own stylesheet: its unlayered rules would override Surflane. data-theme picks the theme before the first paint; surf-typography applies document typography.
3. Check
- The page source has
data-themeon<html>. - The button fills with the brand color. Plain text means the styles did not load.
With AppShell
AppShell fills the window and its edge is square, so the document around it must not show: remove the browser's 8px body margin and paint the background in the shell's chrome. The shell takes its container's height, so give the window's height to the document and to the element your app renders into, #root here. On a phone the page inside meets the screen's edges.Your CSS and the layers
- Surflane keeps its rules in
surflane.*cascade layers, so your own unlayered CSS overrides them, whatever the specificity. - A reset stays below Surflane when you declare its layer first, as in the example under “Layer order”.