You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allows users to component to create consistent markup for the actions users are expected to take when shown an Interruption panel.
The actions only show if the Panel is an Interruption panel and can be:
- buttons, both `button` and `submit` type (the `attributes` option allows to set `form`, `name` and `value` for the `submit` type)
- links, both regular and button-looking links
The containing element (`govuk-panel__actions`) can receive custom `classes` and `attributes`, as can each action listed in the `items` list of actions.
Having a specific element to target allows us to simplify CSS selectors for adjusting spacing around the panel's actions.
Co-authored-by: Nick Colley <2445413+NickColley@users.noreply.github.com>
description: HTML attributes (for example data attributes) to add to the panel container.
34
+
- name: actions
35
+
type: object
36
+
required: false
37
+
description: If creating an Interruption panel, the buttons and links that you want to display. `actions` defaults to `"button"` unless you set `href`, which renders the action as a link.
38
+
params:
39
+
- name: items
40
+
type: array
41
+
required: false
42
+
params:
43
+
- name: text
44
+
type: string
45
+
required: true
46
+
description: The button or link text.
47
+
- name: type
48
+
type: string
49
+
required: false
50
+
description: The type of button – `"button"` or `"submit"`. If `href` is provided, set `type` to `"button"` render a link styled as a button.
51
+
- name: href
52
+
type: string
53
+
required: false
54
+
description: The `href` for a link. Set `type` to `"button"` and set `href` to render a link styled as a button.
55
+
- name: classes
56
+
type: string
57
+
required: false
58
+
description: The additional classes that you want to add to the button or link.
59
+
- name: attributes
60
+
type: object
61
+
required: false
62
+
description: The additional attributes that you want to add to the button or link. For example, data attributes.
63
+
- name: classes
64
+
type: string
65
+
required: false
66
+
description: The additional classes that you want to add to the `govuk-panel__actions` element that wraps the buttons or links.
67
+
- name: attributes
68
+
type: object
69
+
required: false
70
+
description: The additional attributes that you want to add to the `govuk-panel__actions` element that wraps the buttons or links. For example, data attributes.
34
71
35
72
examples:
36
73
- name: default
@@ -44,12 +81,12 @@ examples:
44
81
titleText: Is your age correct?
45
82
html: |
46
83
<p class="govuk-body">You entered your age as <strong>109</strong>.</p>
0 commit comments