Container
A responsive and customizable layout container for consistent spacing and width management.
Previews with Code
Default Container
Installation
The Container
component provides consistent width and spacing for layout management.
Quickly add the component using:
Variant Container
Styled Container
Installation
The Container
component provides consistent width and spacing for layout management.
Quickly add the component using:
File Structure
Props
The Container
component accepts the following props:
Prop | Type | Default |
---|---|---|
variant | "default" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "default" |
className | string | - |
otherProps | React.HTMLAttributes<HTMLDivElement> | - |
Features
The Container
component includes the following features:
- Predefined Width Variants:
- Sizes range from
sm
to7xl
, ensuring responsive design and consistent spacing.
- Sizes range from
- Customizable Styling:
- Add custom classes via the
className
prop.
- Add custom classes via the
- Utility-First Design:
- Built with utility classes for flexibility and reusability.
- Supports Standard HTML Props:
- Includes all standard
div
element attributes.
- Includes all standard
Accessibility
The Container
component is inherently accessible as it serves as a layout container. Ensure child elements follow accessibility standards.
Conclusion
The Container
component is a simple yet powerful utility for building consistent, responsive layouts. Use it to manage widths and spacing efficiently across your application.