DFE-Digital/govuk-components

View on GitHub
guide/content/components/start-button.slim

Summary

Maintainability
Test Coverage
---
title: Start button
---

p
  | Use a start button for the main call to action on your service’s
    #{govuk_link_to('start page', 'https://design-system.service.gov.uk/patterns/start-pages/').html_safe}.
    Start buttons don't usually submit form data, so they use a link tag rather
    than a button tag.

== render('/partials/example.*',
  caption: "Start button",
  code: start_button_normal)

== render('/partials/example.*',
  caption: "Rendering a start button in a form",
  code: start_button_as_button) do

  markdown:
    If you need to submit data you can make the component render a form
    containing a button instead of a link by passing `as_button: true`. This
    approach uses the Rails `button_to` helper and will render a form that
    will `POST` to the target URL.

  .govuk-warning-text
    span.govuk-warning-text__icon aria-hidden="true"
      | !
    strong.govuk-warning-text__text
      span.govuk-visually-hidden Warning
      | The GOV.UK Design system
      =< link_to("advises against submitting data with a start button", "https://design-system.service.gov.uk/components/button/#start-buttons").html_safe

== render('/partials/related-navigation.*', links: start_button_info)