Layout

Surface

Neutral background primitive that establishes a tonal layer for nested content and broadcasts its tone to descendants via context.

import { Surface } from '@lostgradient/cinder/surface';
layoutcontainer
01

Overview

A themed container that publishes its tone to descendant components through Svelte context.

Usage

svelte
<script lang="ts">
  import Surface from '@lostgradient/cinder/surface';
</script>

<Surface>Content</Surface>
Live preview
02

When to use

Use when
  • Wrapping a region in a consistent background tone such as default, raised, or sunken.
  • Letting nested components adapt their styling based on the surrounding surface tone.
Avoid when
  • Building a self-contained content card with padding and elevation — use card instead.
  • Standing up a full page scaffold with header and actions — use a hand-rolled page scaffold instead.
03

Examples

Basic surface

Tone variants for framed interface regions.

04

Props

Props for surface
Name Type Default Required Bindable Description
tone 'default' | 'raised' | 'inset' | 'transparent' 'default'
children snippet Content rendered inside the surface container.