@nice-digital/nds-container
TypeScript icon, indicating that this package has built-in type declarations

4.0.12 • Public • Published

@nice-digital/nds-container

Container component for the NICE Design System

Installation

Install Node, and then:

npm i @nice-digital/nds-container --save

Usage

React

Import the Container component from the package and use within JSX:

import React from "react";
import { Container } from "@nice-digital/nds-container";

<Container>
	...
</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.ElementType
  • Default: div

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: boolean
  • Default: false

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.

SCSS

If you're not using React, then import the SCSS directly into your application by:

@forward '@nice-digital/nds-container/scss/container';

HTML

If you're not using React, then include the SCSS as above and use the HTML, for example:

<div class="container">
	...
</div>

<div class="container container--full">
	<p>Full width content here</p>
</div>

Readme

Keywords

Package Sidebar

Install

npm i @nice-digital/nds-container

Weekly Downloads

41

Version

4.0.12

License

MIT

Unpacked Size

6.85 kB

Total Files

6

Last publish

Collaborators

  • dalenice
  • wongcheming
  • johndavey72
  • barkertron
  • martingallagher1980
  • ditprogrammatic
  • ediblecode
  • josealmeida
  • mark-nice
  • nansenst
  • colin.mazurkiewicz
  • imranazad
  • eleanormollett