@fundamental-styles/mcp 0.41.7-rc.8 → 0.41.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/AI_USAGE.md +425 -0
- package/data/CHANGELOG.md +53 -3
- package/data/component-catalog.json +62 -209
- package/data/components/README.md +281 -0
- package/data/components/action-bar.md +443 -0
- package/data/components/ai-busy-indicator.md +79 -0
- package/data/components/ai-loading-bar.md +66 -0
- package/data/components/avatar-btp.md +198 -0
- package/data/components/avatar-group.md +2660 -0
- package/data/components/avatar-product-switch.md +476 -0
- package/data/components/avatar.md +993 -0
- package/data/components/bar.md +574 -0
- package/data/components/border-radius.md +148 -0
- package/data/components/border.md +412 -0
- package/data/components/breadcrumb.md +546 -0
- package/data/components/button-2.md +440 -0
- package/data/components/button-action-sheet.md +292 -0
- package/data/components/button-ai.md +730 -0
- package/data/components/button-btp.md +223 -0
- package/data/components/button-button.md +233 -0
- package/data/components/button-counter.md +176 -0
- package/data/components/button-patterns.md +731 -0
- package/data/components/button-split.md +459 -0
- package/data/components/button.md +469 -0
- package/data/components/calendar.md +5784 -0
- package/data/components/card-card-media.md +707 -0
- package/data/components/card-card.md +2426 -0
- package/data/components/card-layouts.md +1201 -0
- package/data/components/card.md +2404 -0
- package/data/components/carousel.md +1506 -0
- package/data/components/code.md +139 -0
- package/data/components/component-reset.md +272 -0
- package/data/components/components-icons-businesssuiteinappsymbol-icons.md +85 -0
- package/data/components/components-icons-sap-icons.md +147 -0
- package/data/components/components-icons-tnt-icons.md +85 -0
- package/data/components/container-queries.md +221 -0
- package/data/components/container.md +227 -0
- package/data/components/dialog-docs-static-busy-indicator.md +165 -0
- package/data/components/dialog-docs-static-dialog.md +949 -0
- package/data/components/dialog-docs-static-patterns.md +147 -0
- package/data/components/dialog-docs-static-settings.md +528 -0
- package/data/components/dialog-docs-static.md +982 -0
- package/data/components/dialog.md +606 -0
- package/data/components/dynamic-page-dynamic-page.md +1914 -0
- package/data/components/dynamic-page.md +973 -0
- package/data/components/dynamic-side.md +197 -0
- package/data/components/elevation.md +110 -0
- package/data/components/feed-input.md +346 -0
- package/data/components/feed-list.md +580 -0
- package/data/components/fieldset-2.md +292 -0
- package/data/components/fieldset-forms.md +169 -0
- package/data/components/fieldset.md +381 -0
- package/data/components/flexible-column-layout.md +205 -0
- package/data/components/form-group.md +287 -0
- package/data/components/form-header.md +71 -0
- package/data/components/form-item-2.md +98 -0
- package/data/components/form-item-3.md +134 -0
- package/data/components/form-item-4.md +556 -0
- package/data/components/form-item-5.md +182 -0
- package/data/components/form-item-6.md +539 -0
- package/data/components/form-item-7.md +239 -0
- package/data/components/form-item-ai.md +158 -0
- package/data/components/form-item-file-uploader.md +445 -0
- package/data/components/form-item-forms.md +234 -0
- package/data/components/form-item-patterns.md +426 -0
- package/data/components/form-item.md +464 -0
- package/data/components/form-label-ai.md +126 -0
- package/data/components/form-label-layouts.md +306 -0
- package/data/components/form-label-patterns.md +1175 -0
- package/data/components/form-label-status-indicator.md +1083 -0
- package/data/components/form-label-step-input.md +620 -0
- package/data/components/form-label.md +2876 -0
- package/data/components/generic-tag.md +747 -0
- package/data/components/grid-list-grid-list.md +1185 -0
- package/data/components/grid-list.md +1449 -0
- package/data/components/heading.md +66 -0
- package/data/components/horizontal-navigation.md +568 -0
- package/data/components/icon-tab-bar-dev.md +190 -0
- package/data/components/icon-tab-bar.md +2620 -0
- package/data/components/icon.md +171 -0
- package/data/components/iconBusinessSuite.md +92 -0
- package/data/components/iconTnt.md +92 -0
- package/data/components/illustrated-message.md +439 -0
- package/data/components/info-label.md +348 -0
- package/data/components/input-group.md +2068 -0
- package/data/components/label.md +66 -0
- package/data/components/layout-grid.md +447 -0
- package/data/components/layout-panel.md +261 -0
- package/data/components/layouts-layout-grid.md +608 -0
- package/data/components/layouts-paddings.md +133 -0
- package/data/components/layouts-section.md +287 -0
- package/data/components/list-2.md +148 -0
- package/data/components/list-3.md +735 -0
- package/data/components/list-list.md +790 -0
- package/data/components/list-object-list.md +1225 -0
- package/data/components/list.md +1286 -0
- package/data/components/media-queries.md +168 -0
- package/data/components/menu.md +946 -0
- package/data/components/message-box-docs-static-ai.md +149 -0
- package/data/components/message-box-docs-static.md +527 -0
- package/data/components/message-page-upload-collection.md +678 -0
- package/data/components/message-page.md +256 -0
- package/data/components/message-strip.md +977 -0
- package/data/components/message-toast.md +119 -0
- package/data/components/micro-process-flow.md +991 -0
- package/data/components/navigation-menu.md +366 -0
- package/data/components/navigation-navigation.md +1245 -0
- package/data/components/navigation.md +2604 -0
- package/data/components/numeric-content.md +317 -0
- package/data/components/object-attribute.md +96 -0
- package/data/components/object-identifier.md +227 -0
- package/data/components/object-marker.md +202 -0
- package/data/components/object-number.md +327 -0
- package/data/components/object-status.md +1538 -0
- package/data/components/off-screen.md +87 -0
- package/data/components/overflow.md +97 -0
- package/data/components/padding.md +122 -0
- package/data/components/paddings.md +130 -0
- package/data/components/page.md +300 -0
- package/data/components/pagination.md +672 -0
- package/data/components/panel-layouts.md +345 -0
- package/data/components/panel.md +514 -0
- package/data/components/patterns-label.md +74 -0
- package/data/components/popover-2.md +906 -0
- package/data/components/popover-ai.md +466 -0
- package/data/components/popover-btp.md +886 -0
- package/data/components/popover-deprecated.md +308 -0
- package/data/components/popover-message-popover.md +683 -0
- package/data/components/popover-notification.md +1511 -0
- package/data/components/popover-patterns.md +1100 -0
- package/data/components/popover-popover.md +1862 -0
- package/data/components/popover-quick-view.md +385 -0
- package/data/components/popover-timepicker.md +1836 -0
- package/data/components/popover-user-menu.md +1303 -0
- package/data/components/popover.md +1938 -0
- package/data/components/progress-indicator.md +351 -0
- package/data/components/prompt-input-ai.md +226 -0
- package/data/components/prompt-input.md +226 -0
- package/data/components/rating-indicator.md +1469 -0
- package/data/components/resizable-card-layout.md +951 -0
- package/data/components/scrollbar.md +86 -0
- package/data/components/search-field.md +287 -0
- package/data/components/section.md +250 -0
- package/data/components/segmented-button.md +324 -0
- package/data/components/shellbar.md +2183 -0
- package/data/components/side-nav.md +1562 -0
- package/data/components/skeleton.md +243 -0
- package/data/components/slider.md +395 -0
- package/data/components/splitter.md +353 -0
- package/data/components/table.md +2749 -0
- package/data/components/tabs.md +658 -0
- package/data/components/text-text.md +380 -0
- package/data/components/text.md +253 -0
- package/data/components/tile.md +1132 -0
- package/data/components/time.md +818 -0
- package/data/components/title.md +153 -0
- package/data/components/titles.md +83 -0
- package/data/components/token.md +311 -0
- package/data/components/tokenizer.md +398 -0
- package/data/components/tool-header.md +1352 -0
- package/data/components/tool-layout.md +199 -0
- package/data/components/toolbar-ai.md +174 -0
- package/data/components/toolbar-btp.md +526 -0
- package/data/components/toolbar-title-bar.md +473 -0
- package/data/components/toolbar.md +432 -0
- package/data/components/tree.md +1031 -0
- package/data/components/typography.md +435 -0
- package/data/components/variant-management.md +360 -0
- package/data/components/vertical-nav.md +589 -0
- package/data/components/wizard.md +1429 -0
- package/data/examples/Components/dialog/device-specifications.example.html +39 -30
- package/data/examples/Components/shellbar/optional-items.example.html +210 -157
- package/data/examples/Components/shellbar/overflow-toolbar.example.html +202 -177
- package/data/examples/Components/shellbar/responsive-paddings.example.html +217 -146
- package/data/examples/Components/shellbar/responsiveness.example.html +825 -613
- package/data/examples/Components/user-menu/default.example.html +241 -83
- package/data/schemas/badge.schema.json +1 -1
- package/data/schemas/button-split.schema.json +1 -1
- package/data/schemas/component-frontmatter.schema.json +123 -0
- package/data/schemas/component-markdown.schema.json +81 -0
- package/data/schemas/counter.schema.json +1 -1
- package/data/schemas/dynamic-page.schema.json +1 -1
- package/data/schemas/dynamic-side-content.schema.json +1 -1
- package/data/schemas/facet.schema.json +1 -1
- package/data/schemas/fieldset.schema.json +1 -1
- package/data/schemas/flexible-column-layout.schema.json +1 -1
- package/data/schemas/form-group.schema.json +3 -2
- package/data/schemas/form-header.schema.json +1 -1
- package/data/schemas/form-label.schema.json +1 -0
- package/data/schemas/form-message.schema.json +1 -1
- package/data/schemas/grid-list.schema.json +1 -1
- package/data/schemas/input-group.schema.json +1 -1
- package/data/schemas/layout-panel.schema.json +1 -1
- package/data/schemas/page.schema.json +1 -1
- package/data/schemas/quick-view.schema.json +2 -1
- package/data/schemas/section.schema.json +1 -1
- package/data/schemas/side-nav.schema.json +1 -1
- package/data/schemas/splitter.schema.json +1 -1
- package/data/schemas/tabs.schema.json +1 -1
- package/data/schemas/tile.schema.json +1 -1
- package/data/schemas/tool-layout.schema.json +1 -1
- package/data/schemas/user-menu.schema.json +10 -0
- package/data/schemas/wizard.schema.json +1 -1
- package/package.json +1 -1
- package/src/data/load-catalog.d.ts +2 -0
- package/src/data/load-catalog.js +5 -1
- package/src/data/load-catalog.js.map +1 -1
- package/src/data/load-markdown-docs.d.ts +44 -0
- package/src/data/load-markdown-docs.js +179 -0
- package/src/data/load-markdown-docs.js.map +1 -0
- package/src/data/markdown-cache.d.ts +60 -0
- package/src/data/markdown-cache.js +218 -0
- package/src/data/markdown-cache.js.map +1 -0
- package/src/server.js +72 -1
- package/src/server.js.map +1 -1
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: fd-fieldset
|
|
3
|
+
title: Components/Forms/Field Set
|
|
4
|
+
category: Components
|
|
5
|
+
selector: fd-fieldset
|
|
6
|
+
cssFile: fieldset.css
|
|
7
|
+
sourcePath: packages/styles/stories/Components/Forms/form-fieldset/form-fieldset.stories.js
|
|
8
|
+
tags: []
|
|
9
|
+
dependencies: []
|
|
10
|
+
relatedComponents: []
|
|
11
|
+
stability: stable
|
|
12
|
+
generatedAt: 2026-06-09T18:29:01.614Z
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Components/Forms/Field Set
|
|
16
|
+
|
|
17
|
+
A fieldset is used to give semantic meaning to a group of elements inside a form (e.g. Billing or Shipping Address).
|
|
18
|
+
Grouping fields together into a fieldset also provides styling and accessibility benefits.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install fundamental-styles
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<!-- Include theme -->
|
|
28
|
+
<link href="node_modules/fundamental-styles/dist/theming/sap_horizon.css" rel="stylesheet">
|
|
29
|
+
|
|
30
|
+
<!-- Include component CSS -->
|
|
31
|
+
<link href="node_modules/fundamental-styles/dist/fieldset.css" rel="stylesheet">
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Basic Usage
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<fieldset class="fd-fieldset">
|
|
39
|
+
<legend class="fd-fieldset__legend">Checkboxes</legend>
|
|
40
|
+
<div class="fd-form-group">
|
|
41
|
+
<div class="fd-form-item">
|
|
42
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez611">
|
|
43
|
+
<label class="fd-checkbox__label" for="Ai4ez611">
|
|
44
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
45
|
+
<span class="fd-checkbox__text">
|
|
46
|
+
Field label
|
|
47
|
+
</span>
|
|
48
|
+
</label>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="fd-form-item">
|
|
51
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez612" checked>
|
|
52
|
+
<label class="fd-checkbox__label" for="Ai4ez612">
|
|
53
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
54
|
+
<span class="fd-checkbox__text">
|
|
55
|
+
Selected State
|
|
56
|
+
</span>
|
|
57
|
+
</label>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="fd-form-item">
|
|
60
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez613">
|
|
61
|
+
<label class="fd-checkbox__label" for="Ai4ez613">
|
|
62
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
63
|
+
<span class="fd-checkbox__text">
|
|
64
|
+
TriState Text
|
|
65
|
+
</span>
|
|
66
|
+
</label>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</fieldset>
|
|
70
|
+
|
|
71
|
+
<fieldset class="fd-fieldset">
|
|
72
|
+
<legend class="fd-fieldset__legend">Checkboxes disabled</legend>
|
|
73
|
+
<div class="fd-form-group">
|
|
74
|
+
<div class="fd-form-item">
|
|
75
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez614" disabled>
|
|
76
|
+
<label class="fd-checkbox__label" for="Ai4ez614">
|
|
77
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
78
|
+
<span class="fd-checkbox__text">
|
|
79
|
+
Field label
|
|
80
|
+
</span>
|
|
81
|
+
</label>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="fd-form-item">
|
|
84
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez615" disabled>
|
|
85
|
+
<label class="fd-checkbox__label" for="Ai4ez615">
|
|
86
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
87
|
+
<span class="fd-checkbox__text">
|
|
88
|
+
Field label
|
|
89
|
+
</span>
|
|
90
|
+
</label>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="fd-form-item">
|
|
93
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez616" disabled>
|
|
94
|
+
<label class="fd-checkbox__label" for="Ai4ez616">
|
|
95
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
96
|
+
<span class="fd-checkbox__text">
|
|
97
|
+
Field label
|
|
98
|
+
</span>
|
|
99
|
+
</label>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</fieldset>
|
|
103
|
+
|
|
104
|
+
<fieldset class="fd-fieldset">
|
|
105
|
+
<legend class="fd-fieldset__legend">Checkboxes inline</legend>
|
|
106
|
+
<div class="fd-form-group fd-form-group--inline">
|
|
107
|
+
<div class="fd-form-item">
|
|
108
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez617">
|
|
109
|
+
<label class="fd-checkbox__label" for="Ai4ez617">
|
|
110
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
111
|
+
<span class="fd-checkbox__text">
|
|
112
|
+
Field label
|
|
113
|
+
</span>
|
|
114
|
+
</label>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="fd-form-item">
|
|
117
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez618">
|
|
118
|
+
<label class="fd-checkbox__label" for="Ai4ez618">
|
|
119
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
120
|
+
<span class="fd-checkbox__text">
|
|
121
|
+
Field label
|
|
122
|
+
</span>
|
|
123
|
+
</label>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="fd-form-item">
|
|
126
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez619">
|
|
127
|
+
<label class="fd-checkbox__label" for="Ai4ez619">
|
|
128
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
129
|
+
<span class="fd-checkbox__text">
|
|
130
|
+
Field label
|
|
131
|
+
</span>
|
|
132
|
+
</label>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</fieldset>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## BEM Elements
|
|
139
|
+
|
|
140
|
+
This component uses the following BEM elements:
|
|
141
|
+
|
|
142
|
+
- `fd-fieldset__legend`
|
|
143
|
+
|
|
144
|
+
## Examples
|
|
145
|
+
|
|
146
|
+
### CheckboxGroups
|
|
147
|
+
|
|
148
|
+
Checkbox groups should always be grouped using fieldset for accessibility reasons.
|
|
149
|
+
|
|
150
|
+
```html
|
|
151
|
+
<fieldset class="fd-fieldset">
|
|
152
|
+
<legend class="fd-fieldset__legend">Checkboxes</legend>
|
|
153
|
+
<div class="fd-form-group">
|
|
154
|
+
<div class="fd-form-item">
|
|
155
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez611">
|
|
156
|
+
<label class="fd-checkbox__label" for="Ai4ez611">
|
|
157
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
158
|
+
<span class="fd-checkbox__text">
|
|
159
|
+
Field label
|
|
160
|
+
</span>
|
|
161
|
+
</label>
|
|
162
|
+
</div>
|
|
163
|
+
<div class="fd-form-item">
|
|
164
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez612" checked>
|
|
165
|
+
<label class="fd-checkbox__label" for="Ai4ez612">
|
|
166
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
167
|
+
<span class="fd-checkbox__text">
|
|
168
|
+
Selected State
|
|
169
|
+
</span>
|
|
170
|
+
</label>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="fd-form-item">
|
|
173
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez613">
|
|
174
|
+
<label class="fd-checkbox__label" for="Ai4ez613">
|
|
175
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
176
|
+
<span class="fd-checkbox__text">
|
|
177
|
+
TriState Text
|
|
178
|
+
</span>
|
|
179
|
+
</label>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</fieldset>
|
|
183
|
+
|
|
184
|
+
<fieldset class="fd-fieldset">
|
|
185
|
+
<legend class="fd-fieldset__legend">Checkboxes disabled</legend>
|
|
186
|
+
<div class="fd-form-group">
|
|
187
|
+
<div class="fd-form-item">
|
|
188
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez614" disabled>
|
|
189
|
+
<label class="fd-checkbox__label" for="Ai4ez614">
|
|
190
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
191
|
+
<span class="fd-checkbox__text">
|
|
192
|
+
Field label
|
|
193
|
+
</span>
|
|
194
|
+
</label>
|
|
195
|
+
</div>
|
|
196
|
+
<div class="fd-form-item">
|
|
197
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez615" disabled>
|
|
198
|
+
<label class="fd-checkbox__label" for="Ai4ez615">
|
|
199
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
200
|
+
<span class="fd-checkbox__text">
|
|
201
|
+
Field label
|
|
202
|
+
</span>
|
|
203
|
+
</label>
|
|
204
|
+
</div>
|
|
205
|
+
<div class="fd-form-item">
|
|
206
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez616" disabled>
|
|
207
|
+
<label class="fd-checkbox__label" for="Ai4ez616">
|
|
208
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
209
|
+
<span class="fd-checkbox__text">
|
|
210
|
+
Field label
|
|
211
|
+
</span>
|
|
212
|
+
</label>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</fieldset>
|
|
216
|
+
|
|
217
|
+
<fieldset class="fd-fieldset">
|
|
218
|
+
<legend class="fd-fieldset__legend">Checkboxes inline</legend>
|
|
219
|
+
<div class="fd-form-group fd-form-group--inline">
|
|
220
|
+
<div class="fd-form-item">
|
|
221
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez617">
|
|
222
|
+
<label class="fd-checkbox__label" for="Ai4ez617">
|
|
223
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
224
|
+
<span class="fd-checkbox__text">
|
|
225
|
+
Field label
|
|
226
|
+
</span>
|
|
227
|
+
</label>
|
|
228
|
+
</div>
|
|
229
|
+
<div class="fd-form-item">
|
|
230
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez618">
|
|
231
|
+
<label class="fd-checkbox__label" for="Ai4ez618">
|
|
232
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
233
|
+
<span class="fd-checkbox__text">
|
|
234
|
+
Field label
|
|
235
|
+
</span>
|
|
236
|
+
</label>
|
|
237
|
+
</div>
|
|
238
|
+
<div class="fd-form-item">
|
|
239
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez619">
|
|
240
|
+
<label class="fd-checkbox__label" for="Ai4ez619">
|
|
241
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
242
|
+
<span class="fd-checkbox__text">
|
|
243
|
+
Field label
|
|
244
|
+
</span>
|
|
245
|
+
</label>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
</fieldset>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### RadioButtonGroups
|
|
252
|
+
|
|
253
|
+
Radio button groups should always be grouped using fieldset for accessibility reasons.
|
|
254
|
+
|
|
255
|
+
```html
|
|
256
|
+
<fieldset class="fd-fieldset" id="radio1">
|
|
257
|
+
<legend class="fd-fieldset__legend">Radio Buttons</legend>
|
|
258
|
+
<div class="fd-form__group">
|
|
259
|
+
<div class="fd-form-item">
|
|
260
|
+
<input type="radio" class="fd-radio" id="pDidh761" name="radio1" checked>
|
|
261
|
+
<label class="fd-radio__label" for="pDidh761">
|
|
262
|
+
<span class="fd-radio__text">Field label</span>
|
|
263
|
+
</label>
|
|
264
|
+
</div>
|
|
265
|
+
<div class="fd-form-item">
|
|
266
|
+
<input type="radio" class="fd-radio" id="pDidh7612" name="radio1">
|
|
267
|
+
<label class="fd-radio__label" for="pDidh7612">
|
|
268
|
+
<span class="fd-radio__text">Field label</span>
|
|
269
|
+
</label>
|
|
270
|
+
</div>
|
|
271
|
+
<div class="fd-form-item">
|
|
272
|
+
<input type="radio" class="fd-radio" id="pDidh7613" name="radio1">
|
|
273
|
+
<label class="fd-radio__label" for="pDidh7613">
|
|
274
|
+
<span class="fd-radio__text">Field label</span>
|
|
275
|
+
</label>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</fieldset>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Accessibility
|
|
282
|
+
|
|
283
|
+
- Use semantic HTML elements where appropriate
|
|
284
|
+
- Include proper ARIA attributes for interactive elements
|
|
285
|
+
- Ensure keyboard navigation support
|
|
286
|
+
- Provide adequate color contrast
|
|
287
|
+
|
|
288
|
+
## Source
|
|
289
|
+
|
|
290
|
+
This documentation was automatically generated from: `packages/styles/stories/Components/Forms/form-fieldset/form-fieldset.stories.js`
|
|
291
|
+
|
|
292
|
+
For the latest updates and interactive examples, see [Storybook](https://sap.github.io/fundamental-styles/).
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: fd-fieldset
|
|
3
|
+
title: Components/Forms/Checkbox
|
|
4
|
+
category: Components
|
|
5
|
+
selector: fd-fieldset
|
|
6
|
+
cssFile: fieldset.css
|
|
7
|
+
sourcePath: packages/styles/stories/Components/Forms/checkbox/checkbox.stories.js
|
|
8
|
+
tags: []
|
|
9
|
+
dependencies: []
|
|
10
|
+
relatedComponents: []
|
|
11
|
+
stability: stable
|
|
12
|
+
generatedAt: 2026-06-09T18:29:01.514Z
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Components/Forms/Checkbox
|
|
16
|
+
|
|
17
|
+
A checkbox lets the user set a binary value such as “true/false”. When the user selects the checkbox, it toggles between:
|
|
18
|
+
|
|
19
|
+
- **Checked**: the state described by the checkbox text applies, or that the item has been chosen.
|
|
20
|
+
- **Un-checked**: the state described by the checkbox is not applied.
|
|
21
|
+
- **Tri-state**: a state that indicates it is neither checked nor unchecked. JavaScript must be used to set the input's 'indeterminate' property to true. The main purpose of the tri-state is to represent a mixed selection of states of dependent input fields. If some (but not all) of the dependent fields are selected, the checkbox shows a partially selected state. This is only a visual state and can’t be achieved by a direct user interaction. In this example the indeterminate state is set on page load.
|
|
22
|
+
|
|
23
|
+
Note: With checkboxes, all options are visible, and the user can make one or more selections.
|
|
24
|
+
|
|
25
|
+
##Usage
|
|
26
|
+
**Use the checkbox if:**
|
|
27
|
+
|
|
28
|
+
- Only one option can be selected or deselected, for example to accept terms of use. Use it only if the meaning is obvious.
|
|
29
|
+
- A group or a list of options can be selected independently of each other.
|
|
30
|
+
- the options are displayed right away without any user interaction.
|
|
31
|
+
- An intermediate selection state (tri-state) is required when multiple sub-options are grouped under a parent option. The tri-state will represent that multiple (but not all) sub-options are selected in the list.
|
|
32
|
+
|
|
33
|
+
**Do not use the checkbox if:**
|
|
34
|
+
|
|
35
|
+
- The user needs to choose multiple options from a large list. Use a **Combo Box Input** instead.
|
|
36
|
+
- The user can choose only one option from a list. Use **Radio Buttons**, a **Select**, or a **List** instead.
|
|
37
|
+
- The user needs to perform instantaneous actions that do not need reviewing or confirming. Consider using a **Switch** instead.
|
|
38
|
+
- There is not enough space available on the screen. Use a **Combo Box** instead.
|
|
39
|
+
|
|
40
|
+
## Usage Guidelines
|
|
41
|
+
|
|
42
|
+
**Use the checkbox if:**
|
|
43
|
+
|
|
44
|
+
- Only one option can be selected or deselected, for example to accept terms of use. Use it only if the meaning is obvious.
|
|
45
|
+
- A group or a list of options can be selected independently of each other.
|
|
46
|
+
- the options are displayed right away without any user interaction.
|
|
47
|
+
- An intermediate selection state (tri-state) is required when multiple sub-options are grouped under a parent option. The tri-state will represent that multiple (but not all) sub-options are selected in the list.
|
|
48
|
+
|
|
49
|
+
## When Not To Use
|
|
50
|
+
|
|
51
|
+
- The user needs to choose multiple options from a large list. Use a **Combo Box Input** instead.
|
|
52
|
+
- The user can choose only one option from a list. Use **Radio Buttons**, a **Select**, or a **List** instead.
|
|
53
|
+
- The user needs to perform instantaneous actions that do not need reviewing or confirming. Consider using a **Switch** instead.
|
|
54
|
+
- There is not enough space available on the screen. Use a **Combo Box** instead.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install fundamental-styles
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<!-- Include theme -->
|
|
64
|
+
<link href="node_modules/fundamental-styles/dist/theming/sap_horizon.css" rel="stylesheet">
|
|
65
|
+
|
|
66
|
+
<!-- Include component CSS -->
|
|
67
|
+
<link href="node_modules/fundamental-styles/dist/fieldset.css" rel="stylesheet">
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Basic Usage
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<fieldset class="fd-fieldset">
|
|
75
|
+
<legend class="fd-fieldset__legend">Required checkbox</legend>
|
|
76
|
+
<div class="fd-form-group">
|
|
77
|
+
<div class="fd-form-item">
|
|
78
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez61rc" aria-required="true">
|
|
79
|
+
<label class="fd-checkbox__label fd-checkbox__label--required" for="Ai4ez61rc">
|
|
80
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
81
|
+
<span class="fd-checkbox__label-container">
|
|
82
|
+
<span class="fd-checkbox__text">Required Checkbox</span>
|
|
83
|
+
</span>
|
|
84
|
+
</label>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</fieldset>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## BEM Elements
|
|
91
|
+
|
|
92
|
+
This component uses the following BEM elements:
|
|
93
|
+
|
|
94
|
+
- `fd-fieldset__legend`
|
|
95
|
+
|
|
96
|
+
## Examples
|
|
97
|
+
|
|
98
|
+
### Required
|
|
99
|
+
|
|
100
|
+
To show that a checkbox input is required, use the \
|
|
101
|
+
|
|
102
|
+
```html
|
|
103
|
+
<fieldset class="fd-fieldset">
|
|
104
|
+
<legend class="fd-fieldset__legend">Required checkbox</legend>
|
|
105
|
+
<div class="fd-form-group">
|
|
106
|
+
<div class="fd-form-item">
|
|
107
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez61rc" aria-required="true">
|
|
108
|
+
<label class="fd-checkbox__label fd-checkbox__label--required" for="Ai4ez61rc">
|
|
109
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
110
|
+
<span class="fd-checkbox__label-container">
|
|
111
|
+
<span class="fd-checkbox__text">Required Checkbox</span>
|
|
112
|
+
</span>
|
|
113
|
+
</label>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</fieldset>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Inline
|
|
120
|
+
|
|
121
|
+
Checkboxes can display horizontally in a line. To display them this way, add the `fd-checkbox__label--inline` modifier class to the element.
|
|
122
|
+
|
|
123
|
+
```html
|
|
124
|
+
<fieldset class="fd-fieldset">
|
|
125
|
+
<legend class="fd-fieldset__legend">Inline checkboxes</legend>
|
|
126
|
+
<div class="fd-form-group fd-form-group--inline">
|
|
127
|
+
<div class="fd-form-item">
|
|
128
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez619" disabled checked aria-disabled="true">
|
|
129
|
+
<label class="fd-checkbox__label" for="Ai4ez619">
|
|
130
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
131
|
+
<span class="fd-checkbox__label-container">
|
|
132
|
+
<span class="fd-checkbox__text">Carrots</span>
|
|
133
|
+
</span>
|
|
134
|
+
</label>
|
|
135
|
+
</div>
|
|
136
|
+
<div class="fd-form-item">
|
|
137
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez617">
|
|
138
|
+
<label class="fd-checkbox__label" for="Ai4ez617">
|
|
139
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
140
|
+
<span class="fd-checkbox__label-container">
|
|
141
|
+
<span class="fd-checkbox__text">Potatoes</span>
|
|
142
|
+
</span>
|
|
143
|
+
</label>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="fd-form-item">
|
|
146
|
+
<input type="checkbox" class="fd-checkbox" id="Ai4ez618" checked>
|
|
147
|
+
<label class="fd-checkbox__label" for="Ai4ez618">
|
|
148
|
+
<span class="fd-checkbox__checkmark" aria-hidden="true"></span>
|
|
149
|
+
<span class="fd-checkbox__label-container">
|
|
150
|
+
<span class="fd-checkbox__text">Tomatoes</span>
|
|
151
|
+
</span>
|
|
152
|
+
</label>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</fieldset>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Accessibility
|
|
159
|
+
|
|
160
|
+
- Use semantic HTML elements where appropriate
|
|
161
|
+
- Include proper ARIA attributes for interactive elements
|
|
162
|
+
- Ensure keyboard navigation support
|
|
163
|
+
- Provide adequate color contrast
|
|
164
|
+
|
|
165
|
+
## Source
|
|
166
|
+
|
|
167
|
+
This documentation was automatically generated from: `packages/styles/stories/Components/Forms/checkbox/checkbox.stories.js`
|
|
168
|
+
|
|
169
|
+
For the latest updates and interactive examples, see [Storybook](https://sap.github.io/fundamental-styles/).
|