SurfaceSwitch
Night or paper for the whole page. It sets data-surface on the page and this browser remembers the choice.
import { SurfaceSwitch, DensitySwitch } from '@sypnia/ui/react'
On this page
Night or paper
Press the moon or the sun: the whole page changes.
Code
import { DensitySwitch, SurfaceSwitch } from '@sypnia/ui/react';
// Press it: the whole page changes between night and paper, and this browser remembers it.
export default function Surface() { return <div className="sy-row"><SurfaceSwitch /><DensitySwitch /></div>; } When to use it
Use it when
- In the top bar of apps and docs.
Do not use it when
- Putting it inside a form.
For everyone
- It is a toggle button: it says the current surface and whether paper is on.