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>
Co-authored-by: Calvin Lau <77630796+calvin-lau-sig7@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: Can be used when creating an [interruption panel](https://design-system.service.gov.uk/components/panel/#interruption-panel) which will add a button or link. Default is `button` unless you set `href` which will show the action as a link.
38
+
params:
39
+
- name: items
40
+
type: array
41
+
required: false
42
+
description: The list of buttons or links to display at the end of an Interruption panel.
43
+
params:
44
+
- name: text
45
+
type: string
46
+
required: true
47
+
description: The button or link text.
48
+
- name: type
49
+
type: string
50
+
required: false
51
+
description: The type of button – `"button"` or `"submit"`. If `href` is provided, set `type` to `"button"` render a link styled as a button.
52
+
- name: href
53
+
type: string
54
+
required: false
55
+
description: The `href` for a link. Set `type` to `"button"` and set `href` to render a link styled as a button.
56
+
- name: classes
57
+
type: string
58
+
required: false
59
+
description: The additional classes that you want to add to the button or link.
60
+
- name: attributes
61
+
type: object
62
+
required: false
63
+
description: The additional attributes that you want to add to the button or link. For example, data attributes.
64
+
- name: classes
65
+
type: string
66
+
required: false
67
+
description: The additional classes that you want to add to the `govuk-panel__actions` element that wraps the buttons or links.
68
+
- name: attributes
69
+
type: object
70
+
required: false
71
+
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
72
35
73
examples:
36
74
- name: default
@@ -44,12 +82,12 @@ examples:
44
82
titleText: Is your age correct?
45
83
html: |
46
84
<p class="govuk-body">You entered your age as <strong>109</strong>.</p>
0 commit comments