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
Copy file name to clipboardExpand all lines: packages/nhsuk-frontend/src/nhsuk/components/select/macro-options.mjs
+10-8Lines changed: 10 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ export const params = {
11
11
id: {
12
12
type: 'string',
13
13
required: false,
14
-
description: 'The ID of the select. Defaults to the value of `name`.'
14
+
description: 'ID for the select box. Defaults to the value of `name`.'
15
15
},
16
16
name: {
17
17
type: 'string',
@@ -21,12 +21,13 @@ export const params = {
21
21
items: {
22
22
type: 'array',
23
23
required: true,
24
-
description: 'Array of option items for the select.',
24
+
description: 'The items within the select component.',
25
25
params: {
26
26
value: {
27
27
type: 'string',
28
28
required: false,
29
-
description: 'Value for the option item. Defaults to an empty string.'
29
+
description:
30
+
'Value for the option. If this is omitted, the value is taken from the text content of the option element.'
30
31
},
31
32
text: {
32
33
type: 'string',
@@ -36,7 +37,8 @@ export const params = {
36
37
selected: {
37
38
type: 'boolean',
38
39
required: false,
39
-
description: 'Sets the option as the selected.'
40
+
description:
41
+
'Whether the option should be selected when the page loads. Takes precedence over the top-level `value` option.'
40
42
},
41
43
disabled: {
42
44
type: 'boolean',
@@ -71,21 +73,21 @@ export const params = {
71
73
},
72
74
label: {
73
75
type: 'object',
74
-
required: false,
75
-
description: 'Options for the label component.',
76
+
required: true,
77
+
description: 'The label used by the select component.',
76
78
isComponent: true
77
79
},
78
80
hint: {
79
81
type: 'object',
80
82
required: false,
81
-
description: 'Options for the hint component.',
83
+
description: 'Can be used to add a hint to the select component.',
82
84
isComponent: true
83
85
},
84
86
errorMessage: {
85
87
type: 'object',
86
88
required: false,
87
89
description:
88
-
'Options for the error message component. The error message component will not display if you use a falsy value for `errorMessage`, for example `false` or `null`.',
90
+
'Can be used to add an error message to the select component. The error message component will not display if you use a falsy value for `errorMessage`, for example `false` or `null`.',
0 commit comments