Container

A polymorphic container component for centering content with consistent max-width.

Container Content

This content is centered and constrained.

Installation

bunx --bun shadcn@latest add undefined/r/Container.json

Usage

import { Container } from "@/components/Container"

<Container>
  <h1>My Content</h1>
</Container>

<Container as="section" className="py-10">
  <h2>Section Content</h2>
</Container>

API Reference

PropTypeDefaultDescription
asElementType"div"The HTML element to render (e.g., "section", "main").
childrenReactNode-The content to wrap.
classNamestring-Additional classes.