Container component for the NICE Design System
npm install @nice-digital/nds-container@nice-digital/nds-container> Container component for the NICE Design System
- @nice-digital/nds-container
- Installation
- Usage
- React
- Props
- Container
- children
- className
- elementType
- fullWidth
- SCSS
- HTML
Install Node, and then:
``sh`
npm i @nice-digital/nds-container --save
Import the Container component from the package and use within JSX:
`jsx
import React from "react";
import { Container } from "@nice-digital/nds-container";
...
`
> Note: The React component automatically imports the SCSS, so there's no need to import the SCSS directly yourself.
#### Props
##### Container
###### children
- Type: React.Node | React.Node[] (required)
The content to render inside the container.
###### className
- Type: string""
- Default:
Additional classes to render on the container element. Useful for margin classes e.g. mt--d.
###### elementType
- Type: React.ElementTypediv
- Default:
A custom tag type for the container. Useful if the container covers the whole of the page's unique content, i.e. elementType="main".
###### fullWidth
- Type: booleanfalse
- Default:
An option to override the default max-width of the container ($container-max-width), and set it to 98% of the parent (or viewport's) width.
If you're not using React, then import the SCSS directly into your application by:
`scss`
@forward '@nice-digital/nds-container/scss/container';
If you're not using React, then include the SCSS as above and use the HTML, for example:
`html
...
Full width content here