1. Component Guide
  2. Contextual sidebar
  3. With current step by step
Contextual sidebar example

With current step by step

How it looks (preview)

  1. Step 1 Check you're allowed to drive

    Most people can start learning to drive when they’re 17.

    1. Check what age you can drive
  2. and Testing the and

    hello hello what's UP

  3. Step 2 Driving lessons and practice

    You need a provisional driving licence to take lessons or practice.

    1. The Highway Code

How to call this example

<%= render "govuk_publishing_components/components/contextual_sidebar", {
  content_item: {
    title: "A content item",
    links: {
      part_of_step_navs: [
        {
          title: "Learn to drive a car: step by step",
          base_path: "/micropigs-vs-micropugs",
          details: {
            step_by_step_nav: {
              title: "Stay in the UK after it leaves the EU ('settled status'): step by step",
              steps: [
                {
                  title: "Check you're allowed to drive",
                  contents: [
                    {
                      type: "paragraph",
                      text: "Most people can start learning to drive when they’re 17."
                    },
                    {
                      type: "list",
                      contents: [
                        {
                          text: "Check what age you can drive",
                          href: "/vehicles-can-drive"
                        }
                      ]
                    }
                  ],
                  optional: false
                },
                {
                  title: "Testing the and",
                  logic: "and",
                  contents: [
                    {
                      type: "paragraph",
                      text: "hello hello what's UP"
                    }
                  ]
                },
                {
                  title: "Driving lessons and practice",
                  contents: [
                    {
                      type: "paragraph",
                      text: "You need a provisional driving licence to take lessons or practice."
                    },
                    {
                      type: "list",
                      contents: [
                        {
                          text: "The Highway Code",
                          href: "/guidance/the-highway-code"
                        }
                      ]
                    }
                  ],
                  optional: false
                }
              ]
            }
          }
        }
      ]
    }
  }
} %>