Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Layout and type

Paper

A plain surface: background, radius, optional border and shadow. Card adds a title and layout on top of this.

import { Paper } from "@stylhero/ui";

Example

Code
import { Paper, Stack } from "@stylhero/ui";

function PaperExample() {
  return (
    <Stack direction="row" gap={3} wrap>
      <Paper padding={4}>Raised</Paper>
      <Paper padding={4} elevation={2}>Elevation 2</Paper>
      <Paper padding={4} outlined tone="sunken">Sunken, outlined</Paper>
    </Stack>
  );
}

Props

PropTypeDefaultDescription
as ElementType "div"
elevation 0 | 1 | 2 1 0 = flat, 1 = card shadow, 2 = popover shadow.
outlined boolean -
padding Space - Inner padding in spacing steps. Leave unset to pad with your own classes.
radius "sm" | "md" | "lg" | "none" "lg"
tone "raised" | "sunken" | "page" "raised" "sunken" for wells inside a raised surface.

Also takes every <div> attribute (id, style, data-*, aria-*, event handlers…), passed to that element.

Types

type Space = 0 | 1 | 2 | 3 | 4 | 6 | 8 | 12;

Generated from src/components/Surface.tsx. Something wrong or missing? Open an issue.