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

Container

Centered page column with a 16px gutter on phones.

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

Example

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

function ContainerExample() {
  return (
    <Container size="sm">
      <Paper padding={4} tone="sunken">A centered column, at most the `sm` width, with page gutters.</Paper>
    </Container>
  );
}

Props

PropTypeDefaultDescription
as ElementType "div"
size "sm" | "md" | "lg" | "xl" "lg" Max width: sm 640, md 768, lg 1024, xl 1280.

Also takes the HTML attributes of its root element (id, style, data-*, aria-*, event handlers…).

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