Get Started
Components
- Accordion
- Alert Dialog
- Alert
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button Group
- Button
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Container
- Context Menu
- Data Table
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Flex
- Form
- Grid
- Hero Button
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Responsive
- Scroll Area
- Segmented Control
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spacer
- Spinner
- Squircle
- Switch
- Table
- Tabs
- Textarea
- Theme Toggle
- Toggle Group
- Toggle
- Tooltip
- Typography
- Unicorn Wrapper
Animations
- Background Image Parallax
- Card Swipe Carousel
- Cards Parallax
- Parallax Scroll
- Perspective Carousel
- Perspective Section Transition
- Scroll Expand
- Scroll Fade
- Scroll Scale
- Slide Down
- Slide Up
- Smooth Parallax Scroll
- Smooth Scroll
- Sticky Footer
- Text Along Path
- Text Gradient Opacity
- Text Parallax
- Transforms 3d
- Zoom Parallax
import { Container } from "@/components/ui/container"
export function ContainerDemo() {
return (
<div className="w-full">
<Container className="py-8">
<div className="bg-card border-border text-card-foreground space-y-4 rounded-lg border p-8 shadow-sm">
<h2 className="text-2xl font-bold">Container Component</h2>
<p className="text-muted-foreground">
This content is automatically centered with responsive max-width and
padding.
</p>
<div className="border-border bg-muted/50 mt-4 flex items-center gap-2 rounded-md border p-4">
<div className="bg-muted size-10 rounded-full" />
<div className="flex-1">
<div className="bg-muted mb-2 h-3 w-3/4 rounded" />
<div className="bg-muted/70 h-2 w-1/2 rounded" />
</div>
</div>
</div>
</Container>
</div>
)
}
Installation
pnpm dlx pitsi@latest add container
Usage
import { Container } from "@/components/ui/container"<Container>
<h1>Page Content</h1>
<p>
Your content here will be automatically centered with responsive gutters.
</p>
</Container>Components
The Container component exports several utilities:
Container
The main container component with responsive gutters and centered content.
<Container>
<div>Centered content with gutters</div>
</Container>EscapeContainer
Break out of the container to span the full viewport width.
<Container>
<div>Normal content</div>
<EscapeContainer>
<div>Full-width content</div>
</EscapeContainer>
</Container>SpaceLeft
Add left spacing that matches the container's gutter.
<SpaceLeft>
<div>Content with left spacing</div>
</SpaceLeft>SpaceRight
Add right spacing that matches the container's gutter.
<SpaceRight>
<div>Content with right spacing</div>
</SpaceRight>Props
Container
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | - | The content to be contained |
gutterWidthClassName | string | "[--gutter-width:10svw]" | Custom gutter width CSS variable |
paddingMobileClassName | string | "[--padding-mobile:1rem]" | Custom mobile padding CSS variable |
className | string | - | Additional classes for the wrapper |
classNames | object | - | Classes for specific container parts |
classNames.wrapper | string | - | Classes for the outer wrapper |
classNames.grid | string | - | Classes for the grid container |
classNames.leftBar | string | - | Classes for the left gutter |
classNames.rightBar | string | - | Classes for the right gutter |
classNames.content | string | - | Classes for the content area |
EscapeContainer
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | - | The content to span full width |
className | string | - | Additional classes |
SpaceLeft / SpaceRight
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | - | The content to add spacing to |
className | string | - | Additional classes |
gutterWidthClassName | string | "[--gutter-width:10svw]" | Custom gutter width CSS variable |
paddingMobileClassName | string | "[--padding-mobile:1rem]" | Custom mobile padding CSS variable |