Skip to content
nexubDesign System
v11.9.0

Components · Layout

Container

StableAdded v0.0.1

Centres content at a maximum width with responsive side padding.

import { Container } from '@nexub/react';
View as Markdown

Playground

Props

Centred at up to 640 px, with responsive side padding.

TSX
<Container className={…} size="sm">…</Container>

Examples

Default

Centred at up to 640 px, with responsive side padding.

Prose width

Release notes

The prose size caps lines at about 65 characters, a comfortable measure for reading long text.

States

  • Centred at up to 640 px, with responsive side padding.

    default
  • Centred at up to 640 px, with responsive side padding.

    size="sm"
  • Centred at up to 640 px, with responsive side padding.

    size="md"
  • Centred at up to 640 px, with responsive side padding.

    size="lg"
  • Centred at up to 640 px, with responsive side padding.

    size="xl"
  • Centred at up to 640 px, with responsive side padding.

    size="2xl"
  • Centred at up to 640 px, with responsive side padding.

    size="nexub"
  • Centred at up to 640 px, with responsive side padding.

    size="marketing"
  • Centred at up to 640 px, with responsive side padding.

    size="prose"

Props

Props
PropTypeDefaultDescription
size'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'nexub' | 'marketing' | 'prose''xl'Maximum width, from the --container-* tokens. prose is 65ch for reading.
paddingXbooleantrueResponsive horizontal padding (16, 24, 32 px).
asChildbooleanfalseApply the container classes to the child element (e.g. <main>) instead of a <div>.

On iOS & Android