Skip to content

Column

<ns-column>

Overview

Brings flexibility and control to responsive layouts.

Allows the user interface to split into multiple columns by defining the number of columns required at specific viewports.

Use for arranging components and content, not for gratuitous numerous columns as perhaps seen in a newspaper or magazine.

Examples

Guidance

Implementation

Placement

The ns-column component can be used in the following components:

Specification

Attributes

basketball-court

Property
basketballcourt
Description
Number of columns for basketball court viewport.
Type
string
Options
1 2
Default

hockey-pitch

Property
hockeypitch
Description
Number of columns for hockey pitch viewport.
Type
string
Options
1 2 3 1:2 2:1
Default

football-pitch

Property
footballpitch
Description
Number of columns for football pitch viewport.
Type
string
Options
1 2 3 4 1:2 2:1 1:3 3:1
Default

rugby-pitch

Property
rugbypitch
Description
Number of columns for rugby pitch viewport.
Type
string
Options
1 2 3 4 1:2 2:1 1:3 3:1
Default

polo-field

Property
polofield
Description
Number of columns for polo field viewport.
Type
string
Options
1 2 3 4 1:2 2:1 1:3 3:1
Default

type

Property
type
Type
string
Default
standard

Slots

SlotPermitted tagsDescription
Anonymous slotAnonymous slot for content.

Specification notes

How do viewports inherit values?

Each value is applied at that viewpoint and each larger viewport unless the larger viewport has a column value applied.

Setting 2 columns for every viewport larger than basketball court.

<ns-column basketball-court="2"></ns-column>
How do the 2:1, 3:1 columns work?

Ratios are used in order to have different widths for the columns. The ratios can be 1:2, 2:1, 1:3 and 3:1. The first value will be applied to the width of all odd child elements, and the second to all child even elements.

Considering the example of a 2:1 column, it essentially means that all odd child elements have a width of 2 and all even child elements have a width of 1.

The markup would look like:

<ns-column hockey-pitch="2:1">
<div>This will have width of 2</div>
<div>This will have width of 1</div>
</ns-column>

Last updated: