# Container Containers are the most basic layout element in UX4G and are required when using our default grid system. Containers are used to contain, pad, and (sometimes) center the content within them. **Category:** Layout **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-layout-container--introduction ## Variants documented in Storybook - Showcase: https://doc.ux4g.gov.in/web/?path=/story/ux4g-layout-container--showcase ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Container. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Introduction — Introduction HTML: ```html
Containers are the building blocks of layout in UX4G, providing a way to contain, pad, and center content.
Containers are the most basic layout element in UX4G and are required when using our default grid system. Choose from a responsive, fixed-width container (meaning its max-width changes at each breakpoint) or fluid-width (meaning it’s always 100% wide).
Breakdown of container widths across different breakpoints.
| Class | <576px | ≥576px | ≥768px | ≥992px | ≥1200px | ≥1400px |
|---|---|---|---|---|---|---|
| .ux4g-container | 100% | 540px | 720px | 960px | 1140px | 1320px |
| .ux4g-container-sm | 100% | 540px | 720px | 960px | 1140px | 1320px |
| .ux4g-container-md | 100% | 100% | 720px | 960px | 1140px | 1320px |
| .ux4g-container-lg | 100% | 100% | 100% | 960px | 1140px | 1320px |
| .ux4g-container-xl | 100% | 100% | 100% | 100% | 1140px | 1320px |
| .ux4g-container-2xl | 100% | 100% | 100% | 100% | 100% | 1320px |
| .ux4g-container-fluid | 100% | 100% | 100% | 100% | 100% | 100% |
All container-related utility classes.
|
CONTAINER
ux4g-container
|
|
CONTAINER FLUID
ux4g-container-fluid
|
|
CONTAINER SM
ux4g-container-sm
|
|
CONTAINER MD
ux4g-container-md
|
|
CONTAINER LG
ux4g-container-lg
|
|
CONTAINER XL
ux4g-container-xl
|
|
CONTAINER 2XL
ux4g-container-2xl
|
Containers are the building blocks of layout in UX4G, providing a way to contain, pad, and center content.
Containers are the most basic layout element in UX4G and are required when using our default grid system . Choose from a responsive, fixed-width container (meaning its max-width changes at each breakpoint) or fluid-width (meaning it’s always 100% wide).
Breakdown of container widths across different breakpoints.
| Class | <576px | ≥576px | ≥768px | ≥992px | ≥1200px | ≥1400px |
|---|---|---|---|---|---|---|
| .ux4g-container | 100% | 540px | 720px | 960px | 1140px | 1320px |
| .ux4g-container-sm | 100% | 540px | 720px | 960px | 1140px | 1320px |
| .ux4g-container-md | 100% | 100% | 720px | 960px | 1140px | 1320px |
| .ux4g-container-lg | 100% | 100% | 100% | 960px | 1140px | 1320px |
| .ux4g-container-xl | 100% | 100% | 100% | 100% | 1140px | 1320px |
| .ux4g-container-2xl | 100% | 100% | 100% | 100% | 100% | 1320px |
| .ux4g-container-fluid | 100% | 100% | 100% | 100% | 100% | 100% |
All container-related utility classes.
|
CONTAINER
ux4g-container
|
|
CONTAINER FLUID
ux4g-container-fluid
|
|
CONTAINER SM
ux4g-container-sm
|
|
CONTAINER MD
ux4g-container-md
|
|
CONTAINER LG
ux4g-container-lg
|
|
CONTAINER XL
ux4g-container-xl
|
|
CONTAINER 2XL
ux4g-container-2xl
|
Containers are the building blocks of layout in UX4G, providing a way to contain, pad, and center content.
Containers are the most basic layout element in UX4G and are required when using our default grid system. Choose from a responsive, fixed-width container (meaning its max-width changes at each breakpoint) or fluid-width (meaning it’s always 100% wide).
Breakdown of container widths across different breakpoints.
| Class | <576px | ≥576px | ≥768px | ≥992px | ≥1200px | ≥1400px |
|---|---|---|---|---|---|---|
| .ux4g-container | 100% | 540px | 720px | 960px | 1140px | 1320px |
| .ux4g-container-sm | 100% | 540px | 720px | 960px | 1140px | 1320px |
| .ux4g-container-md | 100% | 100% | 720px | 960px | 1140px | 1320px |
| .ux4g-container-lg | 100% | 100% | 100% | 960px | 1140px | 1320px |
| .ux4g-container-xl | 100% | 100% | 100% | 100% | 1140px | 1320px |
| .ux4g-container-2xl | 100% | 100% | 100% | 100% | 100% | 1320px |
| .ux4g-container-fluid | 100% | 100% | 100% | 100% | 100% | 100% |
All container-related utility classes.
|
CONTAINER
ux4g-container
|
|
CONTAINER FLUID
ux4g-container-fluid
|
|
CONTAINER SM
ux4g-container-sm
|
|
CONTAINER MD
ux4g-container-md
|
|
CONTAINER LG
ux4g-container-lg
|
|
CONTAINER XL
ux4g-container-xl
|
|
CONTAINER 2XL
ux4g-container-2xl
|