Basics Typography Effective, accessible content relies on a clear font, consistent headings, succinct body text paragraphs, descriptive links, and scannable lists.
Font We are investigating how font choice will be incorporated into the design system, in order to meet New Zealand language requirements.
Headings
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import H1 from "@govtnz/ds/build/mustache/H1.mustache";
import H2 from "@govtnz/ds/build/mustache/H2.mustache";
import H3 from "@govtnz/ds/build/mustache/H3.mustache";
import H4 from "@govtnz/ds/build/mustache/H4.mustache";
import H5 from "@govtnz/ds/build/mustache/H5.mustache";
import H6 from "@govtnz/ds/build/mustache/H6.mustache";
// The variables H1, H2, H3, H4, H5, H6 are all strings that are mustache templates.
export default `${Mustache.render(H1, {
"styleSize=xlarge": true,
styleSize: true,
children: `g-heading-xl`
})}${Mustache.render(H2, {
"styleSize=large": true,
styleSize: true,
children: `g-heading-l`
})}${Mustache.render(H3, {
"styleSize=medium": true,
styleSize: true,
children: `g-heading-m`
})}${Mustache.render(H4, {
"styleSize=small": true,
styleSize: true,
children: `g-heading-s`
})}${Mustache.render(H5, {
"styleSize=xsmall": true,
styleSize: true,
children: `g-heading-xs`
})}${Mustache.render(H6, {
"styleSize=xxsmall": true,
styleSize: true,
children: `g-heading-xxs`
})}`;
React (JavaScript) import React from "react";
import H1 from "@govtnz/ds/build/react-js/H1";
import "@govtnz/ds/build/css/H1.css"; // or @govtnz/ds/build/scss/H1.scss
import H2 from "@govtnz/ds/build/react-js/H2";
import "@govtnz/ds/build/css/H2.css"; // or @govtnz/ds/build/scss/H2.scss
import H3 from "@govtnz/ds/build/react-js/H3";
import "@govtnz/ds/build/css/H3.css"; // or @govtnz/ds/build/scss/H3.scss
import H4 from "@govtnz/ds/build/react-js/H4";
import "@govtnz/ds/build/css/H4.css"; // or @govtnz/ds/build/scss/H4.scss
import H5 from "@govtnz/ds/build/react-js/H5";
import "@govtnz/ds/build/css/H5.css"; // or @govtnz/ds/build/scss/H5.scss
import H6 from "@govtnz/ds/build/react-js/H6";
import "@govtnz/ds/build/css/H6.css"; // or @govtnz/ds/build/scss/H6.scss
export default () => (
<React.Fragment>
<H1 styleSize="xlarge">g-heading-xl</H1>
<H2 styleSize="large">g-heading-l</H2>
<H3 styleSize="medium">g-heading-m</H3>
<H4 styleSize="small">g-heading-s</H4>
<H5 styleSize="xsmall">g-heading-xs</H5>
<H6 styleSize="xxsmall">g-heading-xxs</H6>
</React.Fragment>
);
React (TypeScript) import React from "react";
import H1 from "@govtnz/ds/build/react-ts/H1";
import "@govtnz/ds/build/css/H1.css"; // or @govtnz/ds/build/scss/H1.scss
import H2 from "@govtnz/ds/build/react-ts/H2";
import "@govtnz/ds/build/css/H2.css"; // or @govtnz/ds/build/scss/H2.scss
import H3 from "@govtnz/ds/build/react-ts/H3";
import "@govtnz/ds/build/css/H3.css"; // or @govtnz/ds/build/scss/H3.scss
import H4 from "@govtnz/ds/build/react-ts/H4";
import "@govtnz/ds/build/css/H4.css"; // or @govtnz/ds/build/scss/H4.scss
import H5 from "@govtnz/ds/build/react-ts/H5";
import "@govtnz/ds/build/css/H5.css"; // or @govtnz/ds/build/scss/H5.scss
import H6 from "@govtnz/ds/build/react-ts/H6";
import "@govtnz/ds/build/css/H6.css"; // or @govtnz/ds/build/scss/H6.scss
export default () => (
<React.Fragment>
<H1 styleSize="xlarge">g-heading-xl</H1>
<H2 styleSize="large">g-heading-l</H2>
<H3 styleSize="medium">g-heading-m</H3>
<H4 styleSize="small">g-heading-s</H4>
<H5 styleSize="xsmall">g-heading-xs</H5>
<H6 styleSize="xxsmall">g-heading-xxs</H6>
</React.Fragment>
);
React with Styled Components (JavaScript) import React from "react";
import H1 from "@govtnz/ds/build/react-js-styled-components/H1";
import H2 from "@govtnz/ds/build/react-js-styled-components/H2";
import H3 from "@govtnz/ds/build/react-js-styled-components/H3";
import H4 from "@govtnz/ds/build/react-js-styled-components/H4";
import H5 from "@govtnz/ds/build/react-js-styled-components/H5";
import H6 from "@govtnz/ds/build/react-js-styled-components/H6";
export default () => (
<React.Fragment>
<H1 styleSize="xlarge">g-heading-xl</H1>
<H2 styleSize="large">g-heading-l</H2>
<H3 styleSize="medium">g-heading-m</H3>
<H4 styleSize="small">g-heading-s</H4>
<H5 styleSize="xsmall">g-heading-xs</H5>
<H6 styleSize="xxsmall">g-heading-xxs</H6>
</React.Fragment>
);
React with Styled Components (TypeScript) import React from "react";
import H1 from "@govtnz/ds/build/react-ts-styled-components/H1";
import H2 from "@govtnz/ds/build/react-ts-styled-components/H2";
import H3 from "@govtnz/ds/build/react-ts-styled-components/H3";
import H4 from "@govtnz/ds/build/react-ts-styled-components/H4";
import H5 from "@govtnz/ds/build/react-ts-styled-components/H5";
import H6 from "@govtnz/ds/build/react-ts-styled-components/H6";
export default () => (
<React.Fragment>
<H1 styleSize="xlarge">g-heading-xl</H1>
<H2 styleSize="large">g-heading-l</H2>
<H3 styleSize="medium">g-heading-m</H3>
<H4 styleSize="small">g-heading-s</H4>
<H5 styleSize="xsmall">g-heading-xs</H5>
<H6 styleSize="xxsmall">g-heading-xxs</H6>
</React.Fragment>
);
Vue (JavaScript) <template>
<c-h1 styleSize="xlarge">
g-heading-xl
</c-h1>
<c-h2 styleSize="large">
g-heading-l
</c-h2>
<c-h3 styleSize="medium">
g-heading-m
</c-h3>
<c-h4 styleSize="small">
g-heading-s
</c-h4>
<c-h5 styleSize="xsmall">
g-heading-xs
</c-h5>
<c-h6 styleSize="xxsmall">
g-heading-xxs
</c-h6>
</template>
<script>
import Vue from "vue";
import H1 from "@govtnz/ds/build/vue-js/H1.vue";
import H2 from "@govtnz/ds/build/vue-js/H2.vue";
import H3 from "@govtnz/ds/build/vue-js/H3.vue";
import H4 from "@govtnz/ds/build/vue-js/H4.vue";
import H5 from "@govtnz/ds/build/vue-js/H5.vue";
import H6 from "@govtnz/ds/build/vue-js/H6.vue";
export default {
components: {
"c-h1": H1,
"c-h2": H2,
"c-h3": H3,
"c-h4": H4,
"c-h5": H5,
"c-h6": H6
}
};
</script>
Vue (TypeScript) <template>
<c-h1 styleSize="xlarge">
g-heading-xl
</c-h1>
<c-h2 styleSize="large">
g-heading-l
</c-h2>
<c-h3 styleSize="medium">
g-heading-m
</c-h3>
<c-h4 styleSize="small">
g-heading-s
</c-h4>
<c-h5 styleSize="xsmall">
g-heading-xs
</c-h5>
<c-h6 styleSize="xxsmall">
g-heading-xxs
</c-h6>
</template>
<script lang="ts">
import Vue from "vue";
import H1 from "@govtnz/ds/build/vue-ts/H1.vue";
import H2 from "@govtnz/ds/build/vue-ts/H2.vue";
import H3 from "@govtnz/ds/build/vue-ts/H3.vue";
import H4 from "@govtnz/ds/build/vue-ts/H4.vue";
import H5 from "@govtnz/ds/build/vue-ts/H5.vue";
import H6 from "@govtnz/ds/build/vue-ts/H6.vue";
export default {
components: {
"c-h1": H1,
"c-h2": H2,
"c-h3": H3,
"c-h4": H4,
"c-h5": H5,
"c-h6": H6
}
};
</script>
HTML <!--
Remember to add these styles:
in CSS: H1.css, H2.css, H3.css, H4.css, H5.css, H6.css
OR in Sass (SCSS): H1.scss, H2.scss, H3.scss, H4.scss, H5.scss, H6.scss
-->
<h1 class="g-heading g-heading-xl">g-heading-xl</h1>
<h2 class="g-heading g-heading-l">g-heading-l</h2>
<h3 class="g-heading g-heading-m">g-heading-m</h3>
<h4 class="g-heading g-heading-s">g-heading-s</h4>
<h5 class="g-heading g-heading-xs">g-heading-xs</h5>
<h6 class="g-heading g-heading-xxs">g-heading-xxs</h6>
twig-embed {% embed "H1.html.twig" with {'styleSize':'xlarge', 'children':'g-heading-xl'} only %}{% endembed %}{% embed "H2.html.twig" with {'styleSize':'large', 'children':'g-heading-l'} only %}{% endembed %}{% embed "H3.html.twig" with {'styleSize':'medium', 'children':'g-heading-m'} only %}{% endembed %}{% embed "H4.html.twig" with {'styleSize':'small', 'children':'g-heading-s'} only %}{% endembed %}{% embed "H5.html.twig" with {'styleSize':'xsmall', 'children':'g-heading-xs'} only %}{% endembed %}{% embed "H6.html.twig" with {'styleSize':'xxsmall', 'children':'g-heading-xxs'} only %}{% endembed %}
Same heading level varying by size only
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import H3 from "@govtnz/ds/build/mustache/H3.mustache";
// The variables H3 are all strings that are mustache templates.
export default `${Mustache.render(H3, {
"styleSize=xlarge": true,
styleSize: true,
children: `H3 g-heading-xl`
})}${Mustache.render(H3, {
"styleSize=large": true,
styleSize: true,
children: `H3 g-heading-l`
})}${Mustache.render(H3, {
"styleSize=medium": true,
styleSize: true,
children: `H3 g-heading-m`
})}${Mustache.render(H3, {
"styleSize=small": true,
styleSize: true,
children: `H3 g-heading-s`
})}${Mustache.render(H3, {
"styleSize=xsmall": true,
styleSize: true,
children: `H3 g-heading-xs`
})}${Mustache.render(H3, {
"styleSize=xxsmall": true,
styleSize: true,
children: `H3 g-heading-xxs`
})}`;
React (JavaScript) import React from "react";
import H3 from "@govtnz/ds/build/react-js/H3";
import "@govtnz/ds/build/css/H3.css"; // or @govtnz/ds/build/scss/H3.scss
export default () => (
<React.Fragment>
<H3 styleSize="xlarge">H3 g-heading-xl</H3>
<H3 styleSize="large">H3 g-heading-l</H3>
<H3 styleSize="medium">H3 g-heading-m</H3>
<H3 styleSize="small">H3 g-heading-s</H3>
<H3 styleSize="xsmall">H3 g-heading-xs</H3>
<H3 styleSize="xxsmall">H3 g-heading-xxs</H3>
</React.Fragment>
);
React (TypeScript) import React from "react";
import H3 from "@govtnz/ds/build/react-ts/H3";
import "@govtnz/ds/build/css/H3.css"; // or @govtnz/ds/build/scss/H3.scss
export default () => (
<React.Fragment>
<H3 styleSize="xlarge">H3 g-heading-xl</H3>
<H3 styleSize="large">H3 g-heading-l</H3>
<H3 styleSize="medium">H3 g-heading-m</H3>
<H3 styleSize="small">H3 g-heading-s</H3>
<H3 styleSize="xsmall">H3 g-heading-xs</H3>
<H3 styleSize="xxsmall">H3 g-heading-xxs</H3>
</React.Fragment>
);
React with Styled Components (JavaScript) import React from "react";
import H3 from "@govtnz/ds/build/react-js-styled-components/H3";
export default () => (
<React.Fragment>
<H3 styleSize="xlarge">H3 g-heading-xl</H3>
<H3 styleSize="large">H3 g-heading-l</H3>
<H3 styleSize="medium">H3 g-heading-m</H3>
<H3 styleSize="small">H3 g-heading-s</H3>
<H3 styleSize="xsmall">H3 g-heading-xs</H3>
<H3 styleSize="xxsmall">H3 g-heading-xxs</H3>
</React.Fragment>
);
React with Styled Components (TypeScript) import React from "react";
import H3 from "@govtnz/ds/build/react-ts-styled-components/H3";
export default () => (
<React.Fragment>
<H3 styleSize="xlarge">H3 g-heading-xl</H3>
<H3 styleSize="large">H3 g-heading-l</H3>
<H3 styleSize="medium">H3 g-heading-m</H3>
<H3 styleSize="small">H3 g-heading-s</H3>
<H3 styleSize="xsmall">H3 g-heading-xs</H3>
<H3 styleSize="xxsmall">H3 g-heading-xxs</H3>
</React.Fragment>
);
Vue (JavaScript) <template>
<c-h3 styleSize="xlarge">
H3 g-heading-xl
</c-h3>
<c-h3 styleSize="large">
H3 g-heading-l
</c-h3>
<c-h3 styleSize="medium">
H3 g-heading-m
</c-h3>
<c-h3 styleSize="small">
H3 g-heading-s
</c-h3>
<c-h3 styleSize="xsmall">
H3 g-heading-xs
</c-h3>
<c-h3 styleSize="xxsmall">
H3 g-heading-xxs
</c-h3>
</template>
<script>
import Vue from "vue";
import H3 from "@govtnz/ds/build/vue-js/H3.vue";
export default { components: { "c-h3": H3 } };
</script>
Vue (TypeScript) <template>
<c-h3 styleSize="xlarge">
H3 g-heading-xl
</c-h3>
<c-h3 styleSize="large">
H3 g-heading-l
</c-h3>
<c-h3 styleSize="medium">
H3 g-heading-m
</c-h3>
<c-h3 styleSize="small">
H3 g-heading-s
</c-h3>
<c-h3 styleSize="xsmall">
H3 g-heading-xs
</c-h3>
<c-h3 styleSize="xxsmall">
H3 g-heading-xxs
</c-h3>
</template>
<script lang="ts">
import Vue from "vue";
import H3 from "@govtnz/ds/build/vue-ts/H3.vue";
export default { components: { "c-h3": H3 } };
</script>
HTML <!--
Remember to add these styles:
in CSS: H3.css
OR in Sass (SCSS): H3.scss
-->
<h3 class="g-heading g-heading-xl">H3 g-heading-xl</h3>
<h3 class="g-heading g-heading-l">H3 g-heading-l</h3>
<h3 class="g-heading g-heading-m">H3 g-heading-m</h3>
<h3 class="g-heading g-heading-s">H3 g-heading-s</h3>
<h3 class="g-heading g-heading-xs">H3 g-heading-xs</h3>
<h3 class="g-heading g-heading-xxs">H3 g-heading-xxs</h3>
twig-embed {% embed "H3.html.twig" with {'styleSize':'xlarge', 'children':'H3 g-heading-xl'} only %}{% endembed %}{% embed "H3.html.twig" with {'styleSize':'large', 'children':'H3 g-heading-l'} only %}{% endembed %}{% embed "H3.html.twig" with {'styleSize':'medium', 'children':'H3 g-heading-m'} only %}{% endembed %}{% embed "H3.html.twig" with {'styleSize':'small', 'children':'H3 g-heading-s'} only %}{% endembed %}{% embed "H3.html.twig" with {'styleSize':'xsmall', 'children':'H3 g-heading-xs'} only %}{% endembed %}{% embed "H3.html.twig" with {'styleSize':'xxsmall', 'children':'H3 g-heading-xxs'} only %}{% endembed %}
Use headings consistently to create a clear hierarchy throughout your content, and to allow people using assistive technology to quickly scan and move through the page.
Mark up headings semantically using the appropriate <h#>
level HTML element. In our design system, the font size is independent of the heading hierarchy. This allows for design flexibility.
Write all headings in sentence case, with the exception of proper nouns, which require initial capitals.
Headings with captions
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import CaptionXl from "@govtnz/ds/build/mustache/CaptionXl.mustache";
import H1 from "@govtnz/ds/build/mustache/H1.mustache";
import CaptionL from "@govtnz/ds/build/mustache/CaptionL.mustache";
import H2 from "@govtnz/ds/build/mustache/H2.mustache";
import CaptionM from "@govtnz/ds/build/mustache/CaptionM.mustache";
import H3 from "@govtnz/ds/build/mustache/H3.mustache";
// The variables CaptionXl, H1, CaptionL, H2, CaptionM, H3 are all strings that are mustache templates.
export default `${Mustache.render(CaptionXl, {
children: `caption-xl`
})}${Mustache.render(H1, {
"styleSize=xlarge": true,
styleSize: true,
children: `g-heading-xl`
})}${Mustache.render(CaptionL, { children: `caption-l` })}${Mustache.render(
H2,
{ "styleSize=large": true, styleSize: true, children: `g-heading-l` }
)}${Mustache.render(CaptionM, { children: `caption-m` })}${Mustache.render(H3, {
"styleSize=medium": true,
styleSize: true,
children: `g-heading-m`
})}`;
React (JavaScript) import React from "react";
import CaptionXl from "@govtnz/ds/build/react-js/CaptionXl";
import "@govtnz/ds/build/css/CaptionXl.css"; // or @govtnz/ds/build/scss/CaptionXl.scss
import H1 from "@govtnz/ds/build/react-js/H1";
import "@govtnz/ds/build/css/H1.css"; // or @govtnz/ds/build/scss/H1.scss
import CaptionL from "@govtnz/ds/build/react-js/CaptionL";
import "@govtnz/ds/build/css/CaptionL.css"; // or @govtnz/ds/build/scss/CaptionL.scss
import H2 from "@govtnz/ds/build/react-js/H2";
import "@govtnz/ds/build/css/H2.css"; // or @govtnz/ds/build/scss/H2.scss
import CaptionM from "@govtnz/ds/build/react-js/CaptionM";
import "@govtnz/ds/build/css/CaptionM.css"; // or @govtnz/ds/build/scss/CaptionM.scss
import H3 from "@govtnz/ds/build/react-js/H3";
import "@govtnz/ds/build/css/H3.css"; // or @govtnz/ds/build/scss/H3.scss
export default () => (
<React.Fragment>
<CaptionXl>caption-xl</CaptionXl>
<H1 styleSize="xlarge">g-heading-xl</H1>
<CaptionL>caption-l</CaptionL>
<H2 styleSize="large">g-heading-l</H2>
<CaptionM>caption-m</CaptionM>
<H3 styleSize="medium">g-heading-m</H3>
</React.Fragment>
);
React (TypeScript) import React from "react";
import CaptionXl from "@govtnz/ds/build/react-ts/CaptionXl";
import "@govtnz/ds/build/css/CaptionXl.css"; // or @govtnz/ds/build/scss/CaptionXl.scss
import H1 from "@govtnz/ds/build/react-ts/H1";
import "@govtnz/ds/build/css/H1.css"; // or @govtnz/ds/build/scss/H1.scss
import CaptionL from "@govtnz/ds/build/react-ts/CaptionL";
import "@govtnz/ds/build/css/CaptionL.css"; // or @govtnz/ds/build/scss/CaptionL.scss
import H2 from "@govtnz/ds/build/react-ts/H2";
import "@govtnz/ds/build/css/H2.css"; // or @govtnz/ds/build/scss/H2.scss
import CaptionM from "@govtnz/ds/build/react-ts/CaptionM";
import "@govtnz/ds/build/css/CaptionM.css"; // or @govtnz/ds/build/scss/CaptionM.scss
import H3 from "@govtnz/ds/build/react-ts/H3";
import "@govtnz/ds/build/css/H3.css"; // or @govtnz/ds/build/scss/H3.scss
export default () => (
<React.Fragment>
<CaptionXl>caption-xl</CaptionXl>
<H1 styleSize="xlarge">g-heading-xl</H1>
<CaptionL>caption-l</CaptionL>
<H2 styleSize="large">g-heading-l</H2>
<CaptionM>caption-m</CaptionM>
<H3 styleSize="medium">g-heading-m</H3>
</React.Fragment>
);
React with Styled Components (JavaScript) import React from "react";
import CaptionXl from "@govtnz/ds/build/react-js-styled-components/CaptionXl";
import H1 from "@govtnz/ds/build/react-js-styled-components/H1";
import CaptionL from "@govtnz/ds/build/react-js-styled-components/CaptionL";
import H2 from "@govtnz/ds/build/react-js-styled-components/H2";
import CaptionM from "@govtnz/ds/build/react-js-styled-components/CaptionM";
import H3 from "@govtnz/ds/build/react-js-styled-components/H3";
export default () => (
<React.Fragment>
<CaptionXl>caption-xl</CaptionXl>
<H1 styleSize="xlarge">g-heading-xl</H1>
<CaptionL>caption-l</CaptionL>
<H2 styleSize="large">g-heading-l</H2>
<CaptionM>caption-m</CaptionM>
<H3 styleSize="medium">g-heading-m</H3>
</React.Fragment>
);
React with Styled Components (TypeScript) import React from "react";
import CaptionXl from "@govtnz/ds/build/react-ts-styled-components/CaptionXl";
import H1 from "@govtnz/ds/build/react-ts-styled-components/H1";
import CaptionL from "@govtnz/ds/build/react-ts-styled-components/CaptionL";
import H2 from "@govtnz/ds/build/react-ts-styled-components/H2";
import CaptionM from "@govtnz/ds/build/react-ts-styled-components/CaptionM";
import H3 from "@govtnz/ds/build/react-ts-styled-components/H3";
export default () => (
<React.Fragment>
<CaptionXl>caption-xl</CaptionXl>
<H1 styleSize="xlarge">g-heading-xl</H1>
<CaptionL>caption-l</CaptionL>
<H2 styleSize="large">g-heading-l</H2>
<CaptionM>caption-m</CaptionM>
<H3 styleSize="medium">g-heading-m</H3>
</React.Fragment>
);
Vue (JavaScript) <template>
<caption-xl>
caption-xl
</caption-xl>
<c-h1 styleSize="xlarge">
g-heading-xl
</c-h1>
<caption-l>
caption-l
</caption-l>
<c-h2 styleSize="large">
g-heading-l
</c-h2>
<caption-m>
caption-m
</caption-m>
<c-h3 styleSize="medium">
g-heading-m
</c-h3>
</template>
<script>
import Vue from "vue";
import CaptionXl from "@govtnz/ds/build/vue-js/CaptionXl.vue";
import H1 from "@govtnz/ds/build/vue-js/H1.vue";
import CaptionL from "@govtnz/ds/build/vue-js/CaptionL.vue";
import H2 from "@govtnz/ds/build/vue-js/H2.vue";
import CaptionM from "@govtnz/ds/build/vue-js/CaptionM.vue";
import H3 from "@govtnz/ds/build/vue-js/H3.vue";
export default {
components: {
"caption-xl": CaptionXl,
"c-h1": H1,
"caption-l": CaptionL,
"c-h2": H2,
"caption-m": CaptionM,
"c-h3": H3
}
};
</script>
Vue (TypeScript) <template>
<caption-xl>
caption-xl
</caption-xl>
<c-h1 styleSize="xlarge">
g-heading-xl
</c-h1>
<caption-l>
caption-l
</caption-l>
<c-h2 styleSize="large">
g-heading-l
</c-h2>
<caption-m>
caption-m
</caption-m>
<c-h3 styleSize="medium">
g-heading-m
</c-h3>
</template>
<script lang="ts">
import Vue from "vue";
import CaptionXl from "@govtnz/ds/build/vue-ts/CaptionXl.vue";
import H1 from "@govtnz/ds/build/vue-ts/H1.vue";
import CaptionL from "@govtnz/ds/build/vue-ts/CaptionL.vue";
import H2 from "@govtnz/ds/build/vue-ts/H2.vue";
import CaptionM from "@govtnz/ds/build/vue-ts/CaptionM.vue";
import H3 from "@govtnz/ds/build/vue-ts/H3.vue";
export default {
components: {
"caption-xl": CaptionXl,
"c-h1": H1,
"caption-l": CaptionL,
"c-h2": H2,
"caption-m": CaptionM,
"c-h3": H3
}
};
</script>
HTML <!--
Remember to add these styles:
in CSS: CaptionXl.css, H1.css, CaptionL.css, H2.css, CaptionM.css, H3.css
OR in Sass (SCSS): CaptionXl.scss, H1.scss, CaptionL.scss, H2.scss, CaptionM.scss, H3.scss
-->
<span class="g-caption g-caption-xl"> caption-xl </span>
<h1 class="g-heading g-heading-xl">g-heading-xl</h1>
<span class="g-caption g-caption-l"> caption-l </span>
<h2 class="g-heading g-heading-l">g-heading-l</h2>
<span class="g-caption g-caption-m"> caption-m </span>
<h3 class="g-heading g-heading-m">g-heading-m</h3>
twig-embed {% embed "CaptionXl.html.twig" with {'children':'caption-xl'} only %}{% endembed %}{% embed "H1.html.twig" with {'styleSize':'xlarge', 'children':'g-heading-xl'} only %}{% endembed %}{% embed "CaptionL.html.twig" with {'children':'caption-l'} only %}{% endembed %}{% embed "H2.html.twig" with {'styleSize':'large', 'children':'g-heading-l'} only %}{% endembed %}{% embed "CaptionM.html.twig" with {'children':'caption-m'} only %}{% endembed %}{% embed "H3.html.twig" with {'styleSize':'medium', 'children':'g-heading-m'} only %}{% endembed %}
Sometimes you may need to make it clear that content under a heading is part of a larger section or group. To do this, you can use a heading with a caption.
Headings with captions inside the h1
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import H1 from "@govtnz/ds/build/mustache/H1.mustache";
import CaptionXl from "@govtnz/ds/build/mustache/CaptionXl.mustache";
// The variables H1, CaptionXl are all strings that are mustache templates.
export default `${Mustache.render(H1, {
"styleSize=xlarge": true,
styleSize: true,
children: `${Mustache.render(CaptionXl, {
children: `caption-xl`
})}g-heading-xl`
})}`;
React (JavaScript) import React from "react";
import H1 from "@govtnz/ds/build/react-js/H1";
import "@govtnz/ds/build/css/H1.css"; // or @govtnz/ds/build/scss/H1.scss
import CaptionXl from "@govtnz/ds/build/react-js/CaptionXl";
import "@govtnz/ds/build/css/CaptionXl.css"; // or @govtnz/ds/build/scss/CaptionXl.scss
export default () => (
<H1 styleSize="xlarge">
<CaptionXl>caption-xl</CaptionXl>
g-heading-xl
</H1>
);
React (TypeScript) import React from "react";
import H1 from "@govtnz/ds/build/react-ts/H1";
import "@govtnz/ds/build/css/H1.css"; // or @govtnz/ds/build/scss/H1.scss
import CaptionXl from "@govtnz/ds/build/react-ts/CaptionXl";
import "@govtnz/ds/build/css/CaptionXl.css"; // or @govtnz/ds/build/scss/CaptionXl.scss
export default () => (
<H1 styleSize="xlarge">
<CaptionXl>caption-xl</CaptionXl>
g-heading-xl
</H1>
);
React with Styled Components (JavaScript) import React from "react";
import H1 from "@govtnz/ds/build/react-js-styled-components/H1";
import CaptionXl from "@govtnz/ds/build/react-js-styled-components/CaptionXl";
export default () => (
<H1 styleSize="xlarge">
<CaptionXl>caption-xl</CaptionXl>
g-heading-xl
</H1>
);
React with Styled Components (TypeScript) import React from "react";
import H1 from "@govtnz/ds/build/react-ts-styled-components/H1";
import CaptionXl from "@govtnz/ds/build/react-ts-styled-components/CaptionXl";
export default () => (
<H1 styleSize="xlarge">
<CaptionXl>caption-xl</CaptionXl>
g-heading-xl
</H1>
);
Vue (JavaScript) <template>
<c-h1 styleSize="xlarge">
<caption-xl>
caption-xl
</caption-xl>
g-heading-xl
</c-h1>
</template>
<script>
import Vue from "vue";
import H1 from "@govtnz/ds/build/vue-js/H1.vue";
import CaptionXl from "@govtnz/ds/build/vue-js/CaptionXl.vue";
export default { components: { "c-h1": H1, "caption-xl": CaptionXl } };
</script>
Vue (TypeScript) <template>
<c-h1 styleSize="xlarge">
<caption-xl>
caption-xl
</caption-xl>
g-heading-xl
</c-h1>
</template>
<script lang="ts">
import Vue from "vue";
import H1 from "@govtnz/ds/build/vue-ts/H1.vue";
import CaptionXl from "@govtnz/ds/build/vue-ts/CaptionXl.vue";
export default { components: { "c-h1": H1, "caption-xl": CaptionXl } };
</script>
HTML <!--
Remember to add these styles:
in CSS: H1.css, CaptionXl.css
OR in Sass (SCSS): H1.scss, CaptionXl.scss
-->
<h1 class="g-heading g-heading-xl">
<span class="g-caption g-caption-xl"> caption-xl </span> g-heading-xl
</h1>
twig-embed {% embed "H1.html.twig" with {'styleSize':'xlarge'} only %}{% block children %}{% embed "CaptionXl.html.twig" with {'children':'caption-xl'} only %}{% endembed %}
g-heading-xl{% endblock %}{% endembed %}
If the caption should be considered part of the page heading, you can also nest the caption within the h1
.
Paragraphs There are three font sizes for paragraphs, giving you:
a large size for lead paragraphs a medium size for standard body text a smaller size for small body text. You can use these text sizes to indicate the relative importance of the content on the page.
Large size for lead paragraph
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import P from "@govtnz/ds/build/mustache/P.mustache";
// The variables P are all strings that are mustache templates.
export default `${Mustache.render(P, {
"styleSize=large": true,
styleSize: true,
children: `Design and build fast, accessible websites backed by user research, so New Zealanders can easily use government services online.`
})}`;
React (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
export default () => (
<P styleSize="large">
Design and build fast, accessible websites backed by user research, so New
Zealanders can easily use government services online.
</P>
);
React (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
export default () => (
<P styleSize="large">
Design and build fast, accessible websites backed by user research, so New
Zealanders can easily use government services online.
</P>
);
React with Styled Components (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js-styled-components/P";
export default () => (
<P styleSize="large">
Design and build fast, accessible websites backed by user research, so New
Zealanders can easily use government services online.
</P>
);
React with Styled Components (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts-styled-components/P";
export default () => (
<P styleSize="large">
Design and build fast, accessible websites backed by user research, so New
Zealanders can easily use government services online.
</P>
);
Vue (JavaScript) <template>
<c-p styleSize="large">
Design and build fast, accessible websites backed by user research, so New
Zealanders can easily use government services online.
</c-p>
</template>
<script>
import Vue from "vue";
import P from "@govtnz/ds/build/vue-js/P.vue";
export default { components: { "c-p": P } };
</script>
Vue (TypeScript) <template>
<c-p styleSize="large">
Design and build fast, accessible websites backed by user research, so New
Zealanders can easily use government services online.
</c-p>
</template>
<script lang="ts">
import Vue from "vue";
import P from "@govtnz/ds/build/vue-ts/P.vue";
export default { components: { "c-p": P } };
</script>
HTML <!--
Remember to add these styles:
in CSS: P.css
OR in Sass (SCSS): P.scss
-->
<p class="g-body g-body-l">
Design and build fast, accessible websites backed by user research, so New
Zealanders can easily use government services online.
</p>
twig-embed {% embed "P.html.twig" with {'styleSize':'large', 'children':'Design and build fast, accessible websites backed by user research, so New Zealanders can easily use government services online.'} only %}{% endembed %}
A lead paragraph, also called a summary or short description, is the introduction at the top of a page that summarises what a user can expect from that page.
Remember that the summary, along with the title, is usually what users see in search results. Keep the content short, or put the key information at the start, as Google usually only shows the first 160 characters.
Only use one lead paragraph per page.
Medium size for standard body text
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import P from "@govtnz/ds/build/mustache/P.mustache";
// The variables P are all strings that are mustache templates.
export default `${Mustache.render(P, {
children: `The New Zealand Government Design System (NZGDS) is a catalogue of reusable basic elements, components and patterns for building websites and applications, along with guidance on how and when to use them.`
})}`;
React (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
export default () => (
<P>
The New Zealand Government Design System (NZGDS) is a catalogue of reusable
basic elements, components and patterns for building websites and
applications, along with guidance on how and when to use them.
</P>
);
React (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
export default () => (
<P>
The New Zealand Government Design System (NZGDS) is a catalogue of reusable
basic elements, components and patterns for building websites and
applications, along with guidance on how and when to use them.
</P>
);
React with Styled Components (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js-styled-components/P";
export default () => (
<P>
The New Zealand Government Design System (NZGDS) is a catalogue of reusable
basic elements, components and patterns for building websites and
applications, along with guidance on how and when to use them.
</P>
);
React with Styled Components (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts-styled-components/P";
export default () => (
<P>
The New Zealand Government Design System (NZGDS) is a catalogue of reusable
basic elements, components and patterns for building websites and
applications, along with guidance on how and when to use them.
</P>
);
Vue (JavaScript) <template>
<c-p>
The New Zealand Government Design System (NZGDS) is a catalogue of reusable
basic elements, components and patterns for building websites and
applications, along with guidance on how and when to use them.
</c-p>
</template>
<script>
import Vue from "vue";
import P from "@govtnz/ds/build/vue-js/P.vue";
export default { components: { "c-p": P } };
</script>
Vue (TypeScript) <template>
<c-p>
The New Zealand Government Design System (NZGDS) is a catalogue of reusable
basic elements, components and patterns for building websites and
applications, along with guidance on how and when to use them.
</c-p>
</template>
<script lang="ts">
import Vue from "vue";
import P from "@govtnz/ds/build/vue-ts/P.vue";
export default { components: { "c-p": P } };
</script>
HTML <!--
Remember to add these styles:
in CSS: P.css
OR in Sass (SCSS): P.scss
-->
<p class="g-body">
The New Zealand Government Design System (NZGDS) is a catalogue of reusable
basic elements, components and patterns for building websites and
applications, along with guidance on how and when to use them.
</p>
twig-embed {% embed "P.html.twig" with {'children':'The New Zealand Government Design System (NZGDS) is a catalogue of reusable basic elements, components and patterns for building websites and applications, along with guidance on how and when to use them.'} only %}{% endembed %}
The majority of your body copy should use medium size.
Small size for small body text
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import P from "@govtnz/ds/build/mustache/P.mustache";
// The variables P are all strings that are mustache templates.
export default `${Mustache.render(P, {
"styleSize=small": true,
styleSize: true,
children: `Government Information Services is creating the design system now, and you can contribute. This alpha site shows you what we have built so far, what we are working on, and how you can get involved.`
})}`;
React (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
export default () => (
<P styleSize="small">
Government Information Services is creating the design system now, and you
can contribute. This alpha site shows you what we have built so far, what we
are working on, and how you can get involved.
</P>
);
React (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
export default () => (
<P styleSize="small">
Government Information Services is creating the design system now, and you
can contribute. This alpha site shows you what we have built so far, what we
are working on, and how you can get involved.
</P>
);
React with Styled Components (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js-styled-components/P";
export default () => (
<P styleSize="small">
Government Information Services is creating the design system now, and you
can contribute. This alpha site shows you what we have built so far, what we
are working on, and how you can get involved.
</P>
);
React with Styled Components (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts-styled-components/P";
export default () => (
<P styleSize="small">
Government Information Services is creating the design system now, and you
can contribute. This alpha site shows you what we have built so far, what we
are working on, and how you can get involved.
</P>
);
Vue (JavaScript) <template>
<c-p styleSize="small">
Government Information Services is creating the design system now, and you
can contribute. This alpha site shows you what we have built so far, what we
are working on, and how you can get involved.
</c-p>
</template>
<script>
import Vue from "vue";
import P from "@govtnz/ds/build/vue-js/P.vue";
export default { components: { "c-p": P } };
</script>
Vue (TypeScript) <template>
<c-p styleSize="small">
Government Information Services is creating the design system now, and you
can contribute. This alpha site shows you what we have built so far, what we
are working on, and how you can get involved.
</c-p>
</template>
<script lang="ts">
import Vue from "vue";
import P from "@govtnz/ds/build/vue-ts/P.vue";
export default { components: { "c-p": P } };
</script>
HTML <!--
Remember to add these styles:
in CSS: P.css
OR in Sass (SCSS): P.scss
-->
<p class="g-body g-body-s">
Government Information Services is creating the design system now, and you can
contribute. This alpha site shows you what we have built so far, what we are
working on, and how you can get involved.
</p>
twig-embed {% embed "P.html.twig" with {'styleSize':'small', 'children':'Government Information Services is creating the design system now, and you can contribute. This alpha site shows you what we have built so far, what we are working on, and how you can get involved.'} only %}{% endembed %}
Use it sparingly for 'small print' content, such as notes and references.
Links
Default
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import P from "@govtnz/ds/build/mustache/P.mustache";
import A from "@govtnz/ds/build/mustache/A.mustache";
// The variables P, A are all strings that are mustache templates.
export default `${Mustache.render(P, {
children: `${Mustache.render(A, {
href: `#`,
children: `Discuss typography on 'GitHub issues'`
})}`
})}`;
React (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
import A from "@govtnz/ds/build/react-js/A";
import "@govtnz/ds/build/css/A.css"; // or @govtnz/ds/build/scss/A.scss
export default () => (
<P>
<A href="#">Discuss typography on 'GitHub issues'</A>
</P>
);
React (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
import A from "@govtnz/ds/build/react-ts/A";
import "@govtnz/ds/build/css/A.css"; // or @govtnz/ds/build/scss/A.scss
export default () => (
<P>
<A href="#">Discuss typography on 'GitHub issues'</A>
</P>
);
React with Styled Components (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js-styled-components/P";
import A from "@govtnz/ds/build/react-js-styled-components/A";
export default () => (
<P>
<A href="#">Discuss typography on 'GitHub issues'</A>
</P>
);
React with Styled Components (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts-styled-components/P";
import A from "@govtnz/ds/build/react-ts-styled-components/A";
export default () => (
<P>
<A href="#">Discuss typography on 'GitHub issues'</A>
</P>
);
Vue (JavaScript) <template>
<c-p>
<c-a href="#">
Discuss typography on 'GitHub issues'
</c-a>
</c-p>
</template>
<script>
import Vue from "vue";
import P from "@govtnz/ds/build/vue-js/P.vue";
import A from "@govtnz/ds/build/vue-js/A.vue";
export default { components: { "c-p": P, "c-a": A } };
</script>
Vue (TypeScript) <template>
<c-p>
<c-a href="#">
Discuss typography on 'GitHub issues'
</c-a>
</c-p>
</template>
<script lang="ts">
import Vue from "vue";
import P from "@govtnz/ds/build/vue-ts/P.vue";
import A from "@govtnz/ds/build/vue-ts/A.vue";
export default { components: { "c-p": P, "c-a": A } };
</script>
HTML <!--
Remember to add these styles:
in CSS: P.css, A.css
OR in Sass (SCSS): P.scss, A.scss
-->
<p class="g-body">
<a class="g-link" href="#"> Discuss typography on 'GitHub issues' </a>
</p>
twig-embed {% embed "P.html.twig" %}{% block children %}{% embed "A.html.twig" with {'href':'#', 'children':'Discuss typography on 'GitHub issues''} only %}{% endembed %}{% endblock %}{% endembed %}
Links are blue and underlined by default. If your link is at the end of a sentence or paragraph, make sure that the linked text does not include the full stop.
Remember to make link text descriptive of the destination. Just “Read more” is not acceptable.
Lists Use lists to break up blocks of text into chunks to make them easier to read.
Bulleted lists
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import P from "@govtnz/ds/build/mustache/P.mustache";
import Ul from "@govtnz/ds/build/mustache/Ul.mustache";
import Li from "@govtnz/ds/build/mustache/Li.mustache";
// The variables P, Ul, Li are all strings that are mustache templates.
export default `${Mustache.render(P, {
children: `To help keep the kitchen clean, please:`
})}${Mustache.render(Ul, {
children: `${Mustache.render(Li, {
children: `replace tea and coffee jars on shelf`
})}${Mustache.render(Li, {
children: `wipe down bench`
})}${Mustache.render(Li, {
children: `wash dishes by:${Mustache.render(Ul, {
children: `${Mustache.render(Li, {
children: `loading the dishwasher, if it's empty`
})}${Mustache.render(Li, {
children: `rinsing and stacking, if dishwasher is going`
})}`
})}`
})}${Mustache.render(Li, { children: `put recycling in labelled bins` })}`
})}`;
React (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
import Ul from "@govtnz/ds/build/react-js/Ul";
import "@govtnz/ds/build/css/Ul.css"; // or @govtnz/ds/build/scss/Ul.scss
import Li from "@govtnz/ds/build/react-js/Li";
import "@govtnz/ds/build/css/Li.css"; // or @govtnz/ds/build/scss/Li.scss
export default () => (
<React.Fragment>
<P>To help keep the kitchen clean, please:</P>
<Ul>
<Li>replace tea and coffee jars on shelf</Li>
<Li>wipe down bench</Li>
<Li>
wash dishes by:
<Ul>
<Li>loading the dishwasher, if it's empty</Li>
<Li>rinsing and stacking, if dishwasher is going</Li>
</Ul>
</Li>
<Li>put recycling in labelled bins</Li>
</Ul>
</React.Fragment>
);
React (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
import Ul from "@govtnz/ds/build/react-ts/Ul";
import "@govtnz/ds/build/css/Ul.css"; // or @govtnz/ds/build/scss/Ul.scss
import Li from "@govtnz/ds/build/react-ts/Li";
import "@govtnz/ds/build/css/Li.css"; // or @govtnz/ds/build/scss/Li.scss
export default () => (
<React.Fragment>
<P>To help keep the kitchen clean, please:</P>
<Ul>
<Li>replace tea and coffee jars on shelf</Li>
<Li>wipe down bench</Li>
<Li>
wash dishes by:
<Ul>
<Li>loading the dishwasher, if it's empty</Li>
<Li>rinsing and stacking, if dishwasher is going</Li>
</Ul>
</Li>
<Li>put recycling in labelled bins</Li>
</Ul>
</React.Fragment>
);
React with Styled Components (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js-styled-components/P";
import Ul from "@govtnz/ds/build/react-js-styled-components/Ul";
import Li from "@govtnz/ds/build/react-js-styled-components/Li";
export default () => (
<React.Fragment>
<P>To help keep the kitchen clean, please:</P>
<Ul>
<Li>replace tea and coffee jars on shelf</Li>
<Li>wipe down bench</Li>
<Li>
wash dishes by:
<Ul>
<Li>loading the dishwasher, if it's empty</Li>
<Li>rinsing and stacking, if dishwasher is going</Li>
</Ul>
</Li>
<Li>put recycling in labelled bins</Li>
</Ul>
</React.Fragment>
);
React with Styled Components (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts-styled-components/P";
import Ul from "@govtnz/ds/build/react-ts-styled-components/Ul";
import Li from "@govtnz/ds/build/react-ts-styled-components/Li";
export default () => (
<React.Fragment>
<P>To help keep the kitchen clean, please:</P>
<Ul>
<Li>replace tea and coffee jars on shelf</Li>
<Li>wipe down bench</Li>
<Li>
wash dishes by:
<Ul>
<Li>loading the dishwasher, if it's empty</Li>
<Li>rinsing and stacking, if dishwasher is going</Li>
</Ul>
</Li>
<Li>put recycling in labelled bins</Li>
</Ul>
</React.Fragment>
);
Vue (JavaScript) <template>
<c-p>
To help keep the kitchen clean, please:
</c-p>
<c-ul>
<c-li>
replace tea and coffee jars on shelf
</c-li>
<c-li>
wipe down bench
</c-li>
<c-li>
wash dishes by:<c-ul>
<c-li>
loading the dishwasher, if it's empty
</c-li>
<c-li>
rinsing and stacking, if dishwasher is going
</c-li>
</c-ul>
</c-li>
<c-li>
put recycling in labelled bins
</c-li>
</c-ul>
</template>
<script>
import Vue from "vue";
import P from "@govtnz/ds/build/vue-js/P.vue";
import Ul from "@govtnz/ds/build/vue-js/Ul.vue";
import Li from "@govtnz/ds/build/vue-js/Li.vue";
export default { components: { "c-p": P, "c-ul": Ul, "c-li": Li } };
</script>
Vue (TypeScript) <template>
<c-p>
To help keep the kitchen clean, please:
</c-p>
<c-ul>
<c-li>
replace tea and coffee jars on shelf
</c-li>
<c-li>
wipe down bench
</c-li>
<c-li>
wash dishes by:<c-ul>
<c-li>
loading the dishwasher, if it's empty
</c-li>
<c-li>
rinsing and stacking, if dishwasher is going
</c-li>
</c-ul>
</c-li>
<c-li>
put recycling in labelled bins
</c-li>
</c-ul>
</template>
<script lang="ts">
import Vue from "vue";
import P from "@govtnz/ds/build/vue-ts/P.vue";
import Ul from "@govtnz/ds/build/vue-ts/Ul.vue";
import Li from "@govtnz/ds/build/vue-ts/Li.vue";
export default { components: { "c-p": P, "c-ul": Ul, "c-li": Li } };
</script>
HTML <!--
Remember to add these styles:
in CSS: P.css, Ul.css, Li.css
OR in Sass (SCSS): P.scss, Ul.scss, Li.scss
-->
<p class="g-body">To help keep the kitchen clean, please:</p>
<ul class="g-ul">
<li>replace tea and coffee jars on shelf</li>
<li>wipe down bench</li>
<li>
wash dishes by:
<ul class="g-ul">
<li>loading the dishwasher, if it's empty</li>
<li>rinsing and stacking, if dishwasher is going</li>
</ul>
</li>
<li>put recycling in labelled bins</li>
</ul>
twig-embed {% embed "P.html.twig" with {'children':'To help keep the kitchen clean, please:'} only %}{% endembed %}{% embed "Ul.html.twig" %}{% block children %}{% embed "Li.html.twig" with {'children':'replace tea and coffee jars on shelf'} only %}{% endembed %}
{% embed "Li.html.twig" with {'children':'wipe down bench'} only %}{% endembed %}
{% embed "Li.html.twig" %}{% block children %}wash dishes by:
{% embed "Ul.html.twig" %}{% block children %}{% embed "Li.html.twig" with {'children':'loading the dishwasher, if it's empty'} only %}{% endembed %}
{% embed "Li.html.twig" with {'children':'rinsing and stacking, if dishwasher is going'} only %}{% endembed %}{% endblock %}{% endembed %}{% endblock %}{% endembed %}
{% embed "Li.html.twig" with {'children':'put recycling in labelled bins'} only %}{% endembed %}{% endblock %}{% endembed %}
Introduce bulleted lists with a partial ‘stub’ sentence ending in a colon. Start each list item with a lowercase letter, and do not use a full stop at the end. Ensure each list item makes grammatical sense when read after the stub sentence above.
Use bulleted lists to highlight options and examples in content, especially when a sentence contains more than three clauses.
Numbered lists
Code Mustache / Handlebars // Developer note: ensure your ".mustache" files are imported as plain text. In Webpack you might use https://github.com/webpack-contrib/raw-loader
import Mustache from "mustache";
import P from "@govtnz/ds/build/mustache/P.mustache";
import Ol from "@govtnz/ds/build/mustache/Ol.mustache";
import Li from "@govtnz/ds/build/mustache/Li.mustache";
// The variables P, Ol, Li are all strings that are mustache templates.
export default `${Mustache.render(P, {
children: `To sign up, you need to complete four steps.`
})}${Mustache.render(Ol, {
children: `${Mustache.render(Li, {
children: `Prove your identity, such as with RealMe`
})}${Mustache.render(Li, {
children: `Provide a passport-sized photo`
})}${Mustache.render(Li, {
children: `Enter your address details:${Mustache.render(Ol, {
children: `${Mustache.render(Li, {
children: `Postal address`
})}${Mustache.render(Li, { children: `Delivery address` })}`
})}`
})}${Mustache.render(Li, { children: `Confirm payment methods` })}`
})}`;
React (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
import Ol from "@govtnz/ds/build/react-js/Ol";
import "@govtnz/ds/build/css/Ol.css"; // or @govtnz/ds/build/scss/Ol.scss
import Li from "@govtnz/ds/build/react-js/Li";
import "@govtnz/ds/build/css/Li.css"; // or @govtnz/ds/build/scss/Li.scss
export default () => (
<React.Fragment>
<P>To sign up, you need to complete four steps.</P>
<Ol>
<Li>Prove your identity, such as with RealMe</Li>
<Li>Provide a passport-sized photo</Li>
<Li>
Enter your address details:
<Ol>
<Li>Postal address</Li>
<Li>Delivery address</Li>
</Ol>
</Li>
<Li>Confirm payment methods</Li>
</Ol>
</React.Fragment>
);
React (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts/P";
import "@govtnz/ds/build/css/P.css"; // or @govtnz/ds/build/scss/P.scss
import Ol from "@govtnz/ds/build/react-ts/Ol";
import "@govtnz/ds/build/css/Ol.css"; // or @govtnz/ds/build/scss/Ol.scss
import Li from "@govtnz/ds/build/react-ts/Li";
import "@govtnz/ds/build/css/Li.css"; // or @govtnz/ds/build/scss/Li.scss
export default () => (
<React.Fragment>
<P>To sign up, you need to complete four steps.</P>
<Ol>
<Li>Prove your identity, such as with RealMe</Li>
<Li>Provide a passport-sized photo</Li>
<Li>
Enter your address details:
<Ol>
<Li>Postal address</Li>
<Li>Delivery address</Li>
</Ol>
</Li>
<Li>Confirm payment methods</Li>
</Ol>
</React.Fragment>
);
React with Styled Components (JavaScript) import React from "react";
import P from "@govtnz/ds/build/react-js-styled-components/P";
import Ol from "@govtnz/ds/build/react-js-styled-components/Ol";
import Li from "@govtnz/ds/build/react-js-styled-components/Li";
export default () => (
<React.Fragment>
<P>To sign up, you need to complete four steps.</P>
<Ol>
<Li>Prove your identity, such as with RealMe</Li>
<Li>Provide a passport-sized photo</Li>
<Li>
Enter your address details:
<Ol>
<Li>Postal address</Li>
<Li>Delivery address</Li>
</Ol>
</Li>
<Li>Confirm payment methods</Li>
</Ol>
</React.Fragment>
);
React with Styled Components (TypeScript) import React from "react";
import P from "@govtnz/ds/build/react-ts-styled-components/P";
import Ol from "@govtnz/ds/build/react-ts-styled-components/Ol";
import Li from "@govtnz/ds/build/react-ts-styled-components/Li";
export default () => (
<React.Fragment>
<P>To sign up, you need to complete four steps.</P>
<Ol>
<Li>Prove your identity, such as with RealMe</Li>
<Li>Provide a passport-sized photo</Li>
<Li>
Enter your address details:
<Ol>
<Li>Postal address</Li>
<Li>Delivery address</Li>
</Ol>
</Li>
<Li>Confirm payment methods</Li>
</Ol>
</React.Fragment>
);
Vue (JavaScript) <template>
<c-p>
To sign up, you need to complete four steps.
</c-p>
<c-ol>
<c-li>
Prove your identity, such as with RealMe
</c-li>
<c-li>
Provide a passport-sized photo
</c-li>
<c-li>
Enter your address details:<c-ol>
<c-li>
Postal address
</c-li>
<c-li>
Delivery address
</c-li>
</c-ol>
</c-li>
<c-li>
Confirm payment methods
</c-li>
</c-ol>
</template>
<script>
import Vue from "vue";
import P from "@govtnz/ds/build/vue-js/P.vue";
import Ol from "@govtnz/ds/build/vue-js/Ol.vue";
import Li from "@govtnz/ds/build/vue-js/Li.vue";
export default { components: { "c-p": P, "c-ol": Ol, "c-li": Li } };
</script>
Vue (TypeScript) <template>
<c-p>
To sign up, you need to complete four steps.
</c-p>
<c-ol>
<c-li>
Prove your identity, such as with RealMe
</c-li>
<c-li>
Provide a passport-sized photo
</c-li>
<c-li>
Enter your address details:<c-ol>
<c-li>
Postal address
</c-li>
<c-li>
Delivery address
</c-li>
</c-ol>
</c-li>
<c-li>
Confirm payment methods
</c-li>
</c-ol>
</template>
<script lang="ts">
import Vue from "vue";
import P from "@govtnz/ds/build/vue-ts/P.vue";
import Ol from "@govtnz/ds/build/vue-ts/Ol.vue";
import Li from "@govtnz/ds/build/vue-ts/Li.vue";
export default { components: { "c-p": P, "c-ol": Ol, "c-li": Li } };
</script>
HTML <!--
Remember to add these styles:
in CSS: P.css, Ol.css, Li.css
OR in Sass (SCSS): P.scss, Ol.scss, Li.scss
-->
<p class="g-body">To sign up, you need to complete four steps.</p>
<ol class="g-ol">
<li>Prove your identity, such as with RealMe</li>
<li>Provide a passport-sized photo</li>
<li>
Enter your address details:
<ol class="g-ol">
<li>Postal address</li>
<li>Delivery address</li>
</ol>
</li>
<li>Confirm payment methods</li>
</ol>
twig-embed {% embed "P.html.twig" with {'children':'To sign up, you need to complete four steps.'} only %}{% endembed %}{% embed "Ol.html.twig" %}{% block children %}{% embed "Li.html.twig" with {'children':'Prove your identity, such as with RealMe'} only %}{% endembed %}
{% embed "Li.html.twig" with {'children':'Provide a passport-sized photo'} only %}{% endembed %}
{% embed "Li.html.twig" %}{% block children %}Enter your address details:
{% embed "Ol.html.twig" %}{% block children %}{% embed "Li.html.twig" with {'children':'Postal address'} only %}{% endembed %}
{% embed "Li.html.twig" with {'children':'Delivery address'} only %}{% endembed %}{% endblock %}{% endembed %}{% endblock %}{% endembed %}
{% embed "Li.html.twig" with {'children':'Confirm payment methods'} only %}{% endembed %}{% endblock %}{% endembed %}
Use numbered lists instead of bulleted lists when the order of the items is relevant.
You do not need a lead-in line for numbered lists, although a summary sentence can be helpful for users. If numbered items are complete sentences, use full stops at the end.
Credit Guidance, original HTML and CSS derived from GOV.UK Design System .
Get in touch If you’ve got a question, idea, or suggestion, email the Design System (DS) team at info@digital.govt.nz , use our NZGDS Slack app , or discuss Typography on 'GitHub issues'.