Skip to main content

Label examples

  • # default

    {
      "text": "National Insurance number"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number"
    }) }}
            
  • # with bold text

    {
      "classes": "govuk-label--s",
      "text": "National Insurance number"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "classes": "govuk-label--s",
      "text": "National Insurance number"
    }) }}
            
  • # styled as xl text

    {
      "text": "National Insurance number",
      "classes": "govuk-label--xl"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "govuk-label--xl"
    }) }}
            
  • # styled as large text

    {
      "text": "National Insurance number",
      "classes": "govuk-label--l"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "govuk-label--l"
    }) }}
            
  • # styled as medium text

    {
      "text": "National Insurance number",
      "classes": "govuk-label--m"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "govuk-label--m"
    }) }}
            
  • # styled as small text

    {
      "text": "National Insurance number",
      "classes": "govuk-label--s"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "govuk-label--s"
    }) }}
            
  • # as page heading xl

    {
      "text": "National Insurance number",
      "classes": "govuk-label--xl",
      "isPageHeading": true
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "govuk-label--xl",
      "isPageHeading": true
    }) }}
            
  • # as page heading l

    {
      "text": "National Insurance number",
      "classes": "govuk-label--l",
      "isPageHeading": true
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "govuk-label--l",
      "isPageHeading": true
    }) }}
            
  • # as page heading m

    {
      "text": "National Insurance number",
      "classes": "govuk-label--m",
      "isPageHeading": true
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "govuk-label--m",
      "isPageHeading": true
    }) }}
            
  • # as page heading s

    {
      "text": "National Insurance number",
      "classes": "govuk-label--s",
      "isPageHeading": true
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "govuk-label--s",
      "isPageHeading": true
    }) }}
            
  • # as page heading without class

    {
      "text": "National Insurance number",
      "isPageHeading": true
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "isPageHeading": true
    }) }}
            
  • # empty

    {}
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({}) }}
            
  • # classes

    {
      "text": "National Insurance number",
      "classes": "extra-class one-more-class"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "classes": "extra-class one-more-class"
    }) }}
            
  • # html as text

    {
      "text": "National Insurance number, <em>NINO</em>"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number, <em>NINO</em>"
    }) }}
            
  • # html

    {
      "html": "National Insurance number <em>NINO</em>"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "html": "National Insurance number <em>NINO</em>"
    }) }}
            
  • # for

    {
      "for": "test-target-element",
      "text": "National Insurance number"
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "for": "test-target-element",
      "text": "National Insurance number"
    }) }}
            
  • # attributes

    {
      "text": "National Insurance number",
      "attributes": {
        "first-attribute": "foo",
        "second-attribute": "bar"
      }
    }
    
    {% from "govuk/components/label/macro.njk" import govukLabel %}
    
    {{ govukLabel({
      "text": "National Insurance number",
      "attributes": {
        "first-attribute": "foo",
        "second-attribute": "bar"
      }
    }) }}