Components · Layout
Container
StableAdded v0.0.1
Centres content at a maximum width with responsive side padding.
import { Container } from '@nexub/react';Playground
Props
Centred at up to 640 px, with responsive side padding.
<Container className={…} size="sm">…</Container>Examples
Default
Prose width
States
Centred at up to 640 px, with responsive side padding.
defaultCentred 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
| Prop | Type | Default | Description |
|---|---|---|---|
| size | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'nexub' | 'marketing' | 'prose' | 'xl' | Maximum width, from the --container-* tokens. prose is 65ch for reading. |
| paddingX | boolean | true | Responsive horizontal padding (16, 24, 32 px). |
| asChild | boolean | false | Apply the container classes to the child element (e.g. <main>) instead of a <div>. |
On iOS & Android
Web only
Container has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.