Skip to content

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
  1. Night or paper
  2. When to use it
  3. For everyone

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.
  1. Night or paper
  2. When to use it
  3. For everyone

    Search pages, sections and terms