Pitsi UI
  • Home
  • Docs
1
1
Sections
  • Get Started
  • Components
  • Animations
  • MCP Server
  • Changelog
Get Started
  • Installation
  • CLI
  • llms.txt
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

Container

PreviousNext

A layout component with gutter and padding management for responsive content centering.

Powered by
shadcn/ui
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

PropTypeDefaultDescription
childrenReact.ReactNode-The content to be contained
gutterWidthClassNamestring"[--gutter-width:10svw]"Custom gutter width CSS variable
paddingMobileClassNamestring"[--padding-mobile:1rem]"Custom mobile padding CSS variable
classNamestring-Additional classes for the wrapper
classNamesobject-Classes for specific container parts
classNames.wrapperstring-Classes for the outer wrapper
classNames.gridstring-Classes for the grid container
classNames.leftBarstring-Classes for the left gutter
classNames.rightBarstring-Classes for the right gutter
classNames.contentstring-Classes for the content area

EscapeContainer

PropTypeDefaultDescription
childrenReact.ReactNode-The content to span full width
classNamestring-Additional classes

SpaceLeft / SpaceRight

PropTypeDefaultDescription
childrenReact.ReactNode-The content to add spacing to
classNamestring-Additional classes
gutterWidthClassNamestring"[--gutter-width:10svw]"Custom gutter width CSS variable
paddingMobileClassNamestring"[--padding-mobile:1rem]"Custom mobile padding CSS variable
CommandContext Menu

On This Page

InstallationUsageComponentsContainerEscapeContainerSpaceLeftSpaceRightPropsContainerEscapeContainerSpaceLeft / SpaceRight

© 2025 pitsi/ui. All rights reserved.

Sign In