@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,469 @@
|
|
|
1
|
+
---
|
|
2
|
+
component: fd-button
|
|
3
|
+
title: Components/Buttons/Button
|
|
4
|
+
category: Components
|
|
5
|
+
selector: fd-button
|
|
6
|
+
cssFile: button.css
|
|
7
|
+
sourcePath: packages/styles/stories/Components/button/button.stories.js
|
|
8
|
+
tags: []
|
|
9
|
+
dependencies: ["button","button-split","icon","menu","popover","segmented-button"]
|
|
10
|
+
relatedComponents: ["button","button-split","icon","menu","popover","segmented-button"]
|
|
11
|
+
stability: stable
|
|
12
|
+
generatedAt: 2026-06-09T18:29:01.377Z
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Components/Buttons/Button
|
|
16
|
+
|
|
17
|
+
The button component is used to trigger an action. All buttons are characterized by the \
|
|
18
|
+
|
|
19
|
+
## Dependencies
|
|
20
|
+
|
|
21
|
+
This component depends on the following CSS files:
|
|
22
|
+
|
|
23
|
+
- `button.css`
|
|
24
|
+
- `button-split.css`
|
|
25
|
+
- `icon.css`
|
|
26
|
+
- `menu.css`
|
|
27
|
+
- `popover.css`
|
|
28
|
+
- `segmented-button.css`
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install fundamental-styles
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<!-- Include theme -->
|
|
38
|
+
<link href="node_modules/fundamental-styles/dist/theming/sap_horizon.css" rel="stylesheet">
|
|
39
|
+
|
|
40
|
+
<!-- Include component CSS -->
|
|
41
|
+
<link href="node_modules/fundamental-styles/dist/button.css" rel="stylesheet">
|
|
42
|
+
|
|
43
|
+
<!-- Include dependencies -->
|
|
44
|
+
<link href="node_modules/fundamental-styles/dist/button.css" rel="stylesheet">
|
|
45
|
+
<link href="node_modules/fundamental-styles/dist/button-split.css" rel="stylesheet">
|
|
46
|
+
<link href="node_modules/fundamental-styles/dist/icon.css" rel="stylesheet">
|
|
47
|
+
<link href="node_modules/fundamental-styles/dist/menu.css" rel="stylesheet">
|
|
48
|
+
<link href="node_modules/fundamental-styles/dist/popover.css" rel="stylesheet">
|
|
49
|
+
<link href="node_modules/fundamental-styles/dist/segmented-button.css" rel="stylesheet">
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Basic Usage
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<button role="button" class="fd-button">
|
|
56
|
+
<span class="fd-button__text">Default Button</span>
|
|
57
|
+
</button>
|
|
58
|
+
<button role="button" class="fd-button fd-button--emphasized">
|
|
59
|
+
<span class="fd-button__text">Emphasized Button</span>
|
|
60
|
+
</button>
|
|
61
|
+
<button role="button" class="fd-button fd-button--ghost">
|
|
62
|
+
<span class="fd-button__text">Ghost Button</span>
|
|
63
|
+
</button>
|
|
64
|
+
<button role="button" class="fd-button fd-button--positive">
|
|
65
|
+
<span class="fd-button__text">Positive Button</span>
|
|
66
|
+
</button>
|
|
67
|
+
<button role="button" class="fd-button fd-button--negative">
|
|
68
|
+
<span class="fd-button__text">Negative Button</span>
|
|
69
|
+
</button>
|
|
70
|
+
<button role="button" class="fd-button fd-button--attention">
|
|
71
|
+
<span class="fd-button__text">Attention Button</span>
|
|
72
|
+
</button>
|
|
73
|
+
<button role="button" class="fd-button fd-button--transparent">
|
|
74
|
+
<span class="fd-button__text">Transparent Button</span>
|
|
75
|
+
</button>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Modifiers
|
|
79
|
+
|
|
80
|
+
| Class | Description |
|
|
81
|
+
|-------|-------------|
|
|
82
|
+
| `fd-button--attention` | Attention button - Requires user attention. Used for actions that need special attention but aren't necessarily positive or negative. Should always be accompanied by descriptive text. |
|
|
83
|
+
| `fd-button--emphasized` | Emphasized button - Primary action button. Used to indicate the main/primary action on a screen. Should be used sparingly - typically only one per page or section. |
|
|
84
|
+
| `fd-button--ghost` | Ghost button - Secondary highlighted actions. Used when a page has a primary action but you need to highlight a secondary action. Common in content toolbars where you want visual emphasis without competing with the primary button. |
|
|
85
|
+
| `fd-button--menu` | Menu button modifier. The menu button is the default trigger for dropdown menus. It's tightly coupled with the Menu component and cannot be used independently. |
|
|
86
|
+
| `fd-button--negative` | Negative button - Destructive or reject actions. Used for negative semantic actions like "Delete", "Reject", or "Cancel". Should always be accompanied by text to clarify the destructive action. |
|
|
87
|
+
| `fd-button--positive` | Positive button - Affirmative or accept actions. Used for positive semantic actions like "Accept", "Approve", or "Confirm". Should always be accompanied by text to clarify the action. |
|
|
88
|
+
| `fd-button--toggled` | A toggle button switches between two states |
|
|
89
|
+
| `fd-button--transparent` | Transparent button - Secondary actions in toolbars. Used for negative path actions within headers/footers, and secondary toolbar actions. Has minimal visual weight with transparent background by default. |
|
|
90
|
+
|
|
91
|
+
## States
|
|
92
|
+
|
|
93
|
+
| Class | Description |
|
|
94
|
+
|-------|-------------|
|
|
95
|
+
| `is-disabled` | Disabled state |
|
|
96
|
+
|
|
97
|
+
## BEM Elements
|
|
98
|
+
|
|
99
|
+
This component uses the following BEM elements:
|
|
100
|
+
|
|
101
|
+
- `fd-button__badge`
|
|
102
|
+
- `fd-button__badge--attention`
|
|
103
|
+
- `fd-button__instructions`
|
|
104
|
+
- `fd-button__text`
|
|
105
|
+
|
|
106
|
+
## Related Components
|
|
107
|
+
|
|
108
|
+
This component works with or depends on:
|
|
109
|
+
|
|
110
|
+
- `button`
|
|
111
|
+
- `button-split`
|
|
112
|
+
- `icon`
|
|
113
|
+
- `menu`
|
|
114
|
+
- `popover`
|
|
115
|
+
- `segmented-button`
|
|
116
|
+
|
|
117
|
+
## Design Tokens
|
|
118
|
+
|
|
119
|
+
Key CSS variables used by this component:
|
|
120
|
+
|
|
121
|
+
- `--attention`
|
|
122
|
+
- `--decisive`
|
|
123
|
+
- `--fdButton_Badge_Height`
|
|
124
|
+
- `--fdButton_Badge_Margin`
|
|
125
|
+
- `--fdButton_Badge_Margin_Inline_Start`
|
|
126
|
+
- `--fdButton_Badge_Offset`
|
|
127
|
+
- `--fdButton_Badge_Padding_Inline`
|
|
128
|
+
- `--fdButton_Badge_Position`
|
|
129
|
+
- `--fdButton_Badge_Position_Attention`
|
|
130
|
+
- `--fdButton_Badge_Size_Attention`
|
|
131
|
+
- `--fdButton_Badge_Width`
|
|
132
|
+
- `--fdButton_Clickable_Height`
|
|
133
|
+
- `--fdButton_Compact_Height`
|
|
134
|
+
- `--fdButton_Font_Family`
|
|
135
|
+
- `--fdButton_Height`
|
|
136
|
+
|
|
137
|
+
*...and 5 more*
|
|
138
|
+
|
|
139
|
+
## Examples
|
|
140
|
+
|
|
141
|
+
### Button styles
|
|
142
|
+
|
|
143
|
+
- **Default button** is used for neutral or informative (secondary) actions.
|
|
144
|
+
- **Emphasized button** is used to indicate the primary action on the screen.
|
|
145
|
+
- **Ghost button** is used to trigger secondary actions. If a page already has a primary action, but you also need to highlight the most important action in a content toolbar, use the ghost style.
|
|
146
|
+
- **Positive button** is used to trigger positive semantic actions, such as _Accept_ and should always be accompanied by text.
|
|
147
|
+
- **Negative button** is used to trigger negative semantic actions, such as _Reject_ and should always be accompanied by text.
|
|
148
|
+
- **Attention button** is used to trigger a semantic action that needs attention and should always be accompanied by text.
|
|
149
|
+
- **Transparent button** is used to trigger a negative path action within a header or footer bar, and secondary actions in toolbars.
|
|
150
|
+
|
|
151
|
+
```html
|
|
152
|
+
<button role="button" class="fd-button">
|
|
153
|
+
<span class="fd-button__text">Default Button</span>
|
|
154
|
+
</button>
|
|
155
|
+
<button role="button" class="fd-button fd-button--emphasized">
|
|
156
|
+
<span class="fd-button__text">Emphasized Button</span>
|
|
157
|
+
</button>
|
|
158
|
+
<button role="button" class="fd-button fd-button--ghost">
|
|
159
|
+
<span class="fd-button__text">Ghost Button</span>
|
|
160
|
+
</button>
|
|
161
|
+
<button role="button" class="fd-button fd-button--positive">
|
|
162
|
+
<span class="fd-button__text">Positive Button</span>
|
|
163
|
+
</button>
|
|
164
|
+
<button role="button" class="fd-button fd-button--negative">
|
|
165
|
+
<span class="fd-button__text">Negative Button</span>
|
|
166
|
+
</button>
|
|
167
|
+
<button role="button" class="fd-button fd-button--attention">
|
|
168
|
+
<span class="fd-button__text">Attention Button</span>
|
|
169
|
+
</button>
|
|
170
|
+
<button role="button" class="fd-button fd-button--transparent">
|
|
171
|
+
<span class="fd-button__text">Transparent Button</span>
|
|
172
|
+
</button>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Toggle button
|
|
176
|
+
|
|
177
|
+
A toggle button switches between two states. First is the active state, second is inactive. Use the toggle button for secondary actions.
|
|
178
|
+
Active (toggled) button should have \
|
|
179
|
+
|
|
180
|
+
```html
|
|
181
|
+
<button role="button" class="fd-button" aria-pressed="false">Default Toggle</button>
|
|
182
|
+
<button role="button" class="fd-button fd-button--emphasized" aria-pressed="false">Emphasized Toggle</button>
|
|
183
|
+
<button role="button" class="fd-button fd-button--ghost" aria-pressed="false">Ghost Toggle</button>
|
|
184
|
+
<button role="button" class="fd-button fd-button--positive" aria-pressed="false">Positive Toggle</button>
|
|
185
|
+
<button role="button" class="fd-button fd-button--negative" aria-pressed="false">Negative Toggle</button>
|
|
186
|
+
<button role="button" class="fd-button fd-button--attention" aria-pressed="false">Attention Toggle</button>
|
|
187
|
+
<button role="button" class="fd-button fd-button--transparent" aria-pressed="false">Transparent Toggle</button>
|
|
188
|
+
<button role="button" class="fd-button fd-button--toggled" aria-pressed="true">Default Toggle</button>
|
|
189
|
+
<button role="button" class="fd-button fd-button--emphasized fd-button--toggled" aria-pressed="true">Emphasized Toggle</button>
|
|
190
|
+
<button role="button" class="fd-button fd-button--ghost fd-button--toggled" aria-pressed="true">Ghost Toggle</button>
|
|
191
|
+
<button role="button" class="fd-button fd-button--positive fd-button--toggled" aria-pressed="true">Positive Toggle</button>
|
|
192
|
+
<button role="button" class="fd-button fd-button--negative fd-button--toggled" aria-pressed="true">Negative Toggle</button>
|
|
193
|
+
<button role="button" class="fd-button fd-button--attention fd-button--toggled" aria-pressed="true">Attention Toggle</button>
|
|
194
|
+
<button role="button" class="fd-button fd-button--transparent fd-button--toggled" aria-pressed="true">Transparent Toggle</button>
|
|
195
|
+
<button role="button" class="fd-button fd-button--toggled" aria-pressed="false" disabled>Default Toggle</button>
|
|
196
|
+
<button role="button" class="fd-button fd-button--emphasized fd-button--toggled" aria-pressed="false" disabled>Emphasized Toggle</button>
|
|
197
|
+
<button role="button" class="fd-button fd-button--ghost fd-button--toggled" aria-pressed="false" disabled>Ghost Toggle</button>
|
|
198
|
+
<button role="button" class="fd-button fd-button--positive fd-button--toggled" aria-pressed="false" disabled>Positive Toggle</button>
|
|
199
|
+
<button role="button" class="fd-button fd-button--negative fd-button--toggled" aria-pressed="false" disabled>Negative Toggle</button>
|
|
200
|
+
<button role="button" class="fd-button fd-button--attention fd-button--toggled" aria-pressed="false" disabled>Attention Toggle</button>
|
|
201
|
+
<button role="button" class="fd-button fd-button--transparent fd-button--toggled" aria-pressed="false" disabled>Transparent Toggle</button>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Button With Badge
|
|
205
|
+
|
|
206
|
+
Button gets a badge in cases of collecting a number of items from various pages in order to trigger an action.
|
|
207
|
+
Currently the Emphasized, Standard, Ghost and Transparent type of buttons are recommended to be used with Badge.
|
|
208
|
+
\n**Counter Badges cannot contain more than 4 characters**.
|
|
209
|
+
\nFor **Attention Badge** use the <code>fd-button__badge--attention</code> modifier class with <code>fd-button__badge</code> base class.
|
|
210
|
+
|
|
211
|
+
```html
|
|
212
|
+
<h4>Counter Badge</h4>
|
|
213
|
+
<button class="fd-button" role="button">
|
|
214
|
+
<span class="fd-button__text">Badge Button</span>
|
|
215
|
+
<span class="fd-button__badge">3984</span>
|
|
216
|
+
</button>
|
|
217
|
+
<button class="fd-button" role="button" title="Add to cart">
|
|
218
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
219
|
+
<span class="fd-button__badge">3</span>
|
|
220
|
+
</button>
|
|
221
|
+
|
|
222
|
+
<h4>Attention Badge</h4>
|
|
223
|
+
<button class="fd-button" role="button">
|
|
224
|
+
<span class="fd-button__text">Badge Button</span>
|
|
225
|
+
<span class="fd-button__badge fd-button__badge--attention" aria-label="Tag Warning"></span>
|
|
226
|
+
</button>
|
|
227
|
+
<button class="fd-button" role="button" title="Add to cart">
|
|
228
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
229
|
+
<span class="fd-button__badge fd-button__badge--attention" aria-label="Tag Warning"></span>
|
|
230
|
+
</button>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Menu button
|
|
234
|
+
|
|
235
|
+
The Menu Button is the default trigger for the Menu (Horizon) component and is tightly coupled with it—it cannot be used independently. While the Menu component can function on its own, the Menu Button relies on it to provide a dropdown.
|
|
236
|
+
<br>
|
|
237
|
+
As a type of button, the Menu Button inherits all standard button types and their respective styles and states.
|
|
238
|
+
|
|
239
|
+
There are two types of Menu Buttons:
|
|
240
|
+
- Default Menu Button-Triggers the dropdown menu on click.
|
|
241
|
+
- Split Menu Button-Offers separate actions: one for a primary action and one for the dropdown.
|
|
242
|
+
|
|
243
|
+
If a fixed width is applied to the Menu Button, the dropdown arrow icon should be right-aligned. The recommended maximum width is 12rem..
|
|
244
|
+
|
|
245
|
+
```html
|
|
246
|
+
<button role="button" class="fd-button fd-button--emphasized fd-button--menu" title="Menu">
|
|
247
|
+
<span class="fd-button__text">Emphasized Button</span>
|
|
248
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
249
|
+
</button>
|
|
250
|
+
<button role="button" class="fd-button fd-button--menu" title="Menu">
|
|
251
|
+
<span class="fd-button__text">Default Button</span>
|
|
252
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
253
|
+
</button>
|
|
254
|
+
<button role="button" class="fd-button fd-button--ghost fd-button--menu" title="Menu">
|
|
255
|
+
<span class="fd-button__text">Ghost Button</span>
|
|
256
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
257
|
+
</button>
|
|
258
|
+
<button role="button" class="fd-button fd-button--positive fd-button--menu" title="Menu">
|
|
259
|
+
<span class="fd-button__text">Positive Button</span>
|
|
260
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
261
|
+
</button>
|
|
262
|
+
<button role="button" class="fd-button fd-button--negative fd-button--menu" title="Menu">
|
|
263
|
+
<span class="fd-button__text">Negative Button</span>
|
|
264
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
265
|
+
</button>
|
|
266
|
+
<button role="button" class="fd-button fd-button--attention fd-button--menu" title="Menu">
|
|
267
|
+
<span class="fd-button__text">Attention Button</span>
|
|
268
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
269
|
+
</button>
|
|
270
|
+
<button role="button" class="fd-button fd-button--transparent fd-button--menu" title="Menu">
|
|
271
|
+
<span class="fd-button__text">Transparent Button</span>
|
|
272
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
273
|
+
</button>
|
|
274
|
+
<button role="button" class="fd-button fd-button--emphasized fd-button--menu" title="Menu">
|
|
275
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
276
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
277
|
+
</button>
|
|
278
|
+
<button role="button" class="fd-button fd-button--menu" title="Menu">
|
|
279
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
280
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
281
|
+
</button>
|
|
282
|
+
<button role="button" class="fd-button fd-button-ghost fd-button--menu" title="Menu">
|
|
283
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
284
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
285
|
+
</button>
|
|
286
|
+
<button role="button" class="fd-button fd-button--menu fd-button--positive" title="Menu">
|
|
287
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
288
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
289
|
+
</button>
|
|
290
|
+
<button role="button" class="fd-button fd-button--menu fd-button--negative" title="Menu">
|
|
291
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
292
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
293
|
+
</button>
|
|
294
|
+
<button role="button" class="fd-button fd-button--menu fd-button--attention" title="Menu">
|
|
295
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
296
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
297
|
+
</button>
|
|
298
|
+
<button role="button" class="fd-button fd-button--menu fd-button--transparent" title="Menu">
|
|
299
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
300
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
301
|
+
</button>
|
|
302
|
+
<h3>Fixed Width</h3>
|
|
303
|
+
<button role="button" class="fd-button fd-button--emphasized fd-button--menu" title="Menu">
|
|
304
|
+
<span class="fd-button__text">Button</span>
|
|
305
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
306
|
+
</button>
|
|
307
|
+
<button role="button" class="fd-button fd-button--menu" title="Menu">
|
|
308
|
+
<span class="fd-button__text">Button</span>
|
|
309
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
310
|
+
</button>
|
|
311
|
+
<button role="button" class="fd-button fd-button--menu" title="Menu">
|
|
312
|
+
<i class="sap-icon--filter" role="presentation" aria-hidden="true"></i>
|
|
313
|
+
<span class="fd-button__text">Button</span>
|
|
314
|
+
<i class="sap-icon--slim-arrow-down" role="presentation" aria-hidden="true"></i>
|
|
315
|
+
</button>
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Icon or text
|
|
319
|
+
|
|
320
|
+
These buttons contain either icons **or** text, as it is highly recommended not to combine the two.
|
|
321
|
+
|
|
322
|
+
**Use icon buttons for basic actions such as:**
|
|
323
|
+
|
|
324
|
+
- _Edit_
|
|
325
|
+
- _Back to previous screen_
|
|
326
|
+
- _Remove from list_ etc.
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
Make sure the default accessibility text for the icon is appropriate for your use case. If the text is not ideal, define an app-specific accessibility text.
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
All button styles can be paired with an icon. You can use the \
|
|
333
|
+
|
|
334
|
+
```html
|
|
335
|
+
<button role="button" class="fd-button fd-button--emphasized">
|
|
336
|
+
<span class="fd-button__text">Add to Cart</span>
|
|
337
|
+
</button>
|
|
338
|
+
<button role="button" class="fd-button">
|
|
339
|
+
<span class="fd-button__text">Add to Cart</span>
|
|
340
|
+
</button>
|
|
341
|
+
<button role="button" class="fd-button fd-button--transparent">
|
|
342
|
+
<span class="fd-button__text">Add to Cart</span>
|
|
343
|
+
</button>
|
|
344
|
+
<button role="button" class="fd-button fd-button--ghost">
|
|
345
|
+
<span class="fd-button__text">Add to Cart</span>
|
|
346
|
+
</button>
|
|
347
|
+
<button role="button" class="fd-button fd-button--positive">
|
|
348
|
+
<span class="fd-button__text">Approve</span>
|
|
349
|
+
</button>
|
|
350
|
+
<button role="button" class="fd-button fd-button--negative">
|
|
351
|
+
<span class="fd-button__text">Reject</span>
|
|
352
|
+
</button>
|
|
353
|
+
<button role="button" class="fd-button fd-button--attention">
|
|
354
|
+
<span class="fd-button__text">Attention</span>
|
|
355
|
+
</button>
|
|
356
|
+
<button role="button" title="Add to cart" class="fd-button fd-button--emphasized">
|
|
357
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
358
|
+
</button>
|
|
359
|
+
<button role="button" title="Add to cart" class="fd-button">
|
|
360
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
361
|
+
</button>
|
|
362
|
+
<button role="button" title="Add to cart" class="fd-button fd-button--transparent">
|
|
363
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
364
|
+
</button>
|
|
365
|
+
<button role="button" title="Filter" class="fd-button fd-button--ghost">
|
|
366
|
+
<i class="sap-icon--filter" role="presentation" aria-hidden="true"></i>
|
|
367
|
+
</button>
|
|
368
|
+
<button role="button" title="Accept" class="fd-button fd-button--positive">
|
|
369
|
+
<i class="sap-icon--accept" role="presentation" aria-hidden="true"></i>
|
|
370
|
+
</button>
|
|
371
|
+
<button role="button" title="Decline" class="fd-button fd-button--negative">
|
|
372
|
+
<i class="sap-icon--decline" role="presentation" aria-hidden="true"></i>
|
|
373
|
+
</button>
|
|
374
|
+
<button role="button" title="Decline" class="fd-button fd-button--attention">
|
|
375
|
+
<i class="sap-icon--decline" role="presentation" aria-hidden="true"></i>
|
|
376
|
+
</button>
|
|
377
|
+
<button aria-label="Add to cart" class="fd-button fd-button--emphasized">
|
|
378
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
379
|
+
<span class="fd-button__text">Add to Cart</span>
|
|
380
|
+
</button>
|
|
381
|
+
<button aria-label="Add to cart" class="fd-button">
|
|
382
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
383
|
+
<span class="fd-button__text">Add to Cart</span>
|
|
384
|
+
</button>
|
|
385
|
+
<button aria-label="Add to cart" class="fd-button fd-button--transparent">
|
|
386
|
+
<i class="sap-icon--cart" role="presentation" aria-hidden="true"></i>
|
|
387
|
+
<span class="fd-button__text">Add to Cart</span>
|
|
388
|
+
</button>
|
|
389
|
+
<button aria-label="Filter" class="fd-button fd-button--ghost">
|
|
390
|
+
<i class="sap-icon--filter" role="presentation" aria-hidden="true"></i>
|
|
391
|
+
<span class="fd-button__text">Filter</span>
|
|
392
|
+
</button>
|
|
393
|
+
<button aria-label="Accept" class="fd-button fd-button--positive">
|
|
394
|
+
<i class="sap-icon--accept" role="presentation" aria-hidden="true"></i>
|
|
395
|
+
<span class="fd-button__text">Accept</span>
|
|
396
|
+
</button>
|
|
397
|
+
<button aria-label="Decline" class="fd-button fd-button--negative">
|
|
398
|
+
<i class="sap-icon--decline" role="presentation" aria-hidden="true"></i>
|
|
399
|
+
<span class="fd-button__text">Decline</span>
|
|
400
|
+
</button>
|
|
401
|
+
<button aria-label="Decline" class="fd-button fd-button--attention">
|
|
402
|
+
<i class="sap-icon--decline" role="presentation" aria-hidden="true"></i>
|
|
403
|
+
<span class="fd-button__text">Decline</span>
|
|
404
|
+
</button>
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Button states
|
|
408
|
+
|
|
409
|
+
These button types indicate different states: normal, selected, disabled and focusable disabled.
|
|
410
|
+
|
|
411
|
+
- **Normal**: The button’s default state. It can be selected to perform a corresponding action.
|
|
412
|
+
- **Disabled**: It cannot be selected. This state can be displayed by using the \
|
|
413
|
+
|
|
414
|
+
```html
|
|
415
|
+
<button role="button" class="fd-button fd-button--emphasized">Normal State</button>
|
|
416
|
+
<button role="button" class="fd-button fd-button--emphasized" aria-disabled="true" disabled>Disabled State</button>
|
|
417
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF1" class="fd-button fd-button--emphasized is-disabled" type="button">Disabled Focusable</button>
|
|
418
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF1">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
419
|
+
<button role="button" class="fd-button">Normal State</button>
|
|
420
|
+
<button role="button" class="fd-button is-disabled" aria-disabled="true" disabled>Disabled State</button>
|
|
421
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF2" class="fd-button is-disabled" type="button">Disabled Focusable</button>
|
|
422
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF2">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
423
|
+
<button role="button" class="fd-button fd-button--transparent">Normal State</button>
|
|
424
|
+
<button role="button" class="fd-button fd-button--transparent is-disabled" aria-disabled="true" disabled>Disabled State</button>
|
|
425
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF3" class="fd-button fd-button--transparent is-disabled" type="button">Disabled Focusable</button>
|
|
426
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF3">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
427
|
+
<button role="button" class="fd-button fd-button">Normal State</button>
|
|
428
|
+
<button role="button" class="fd-button fd-button" aria-disabled="true" disabled>Disabled State</button>
|
|
429
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF4" class="fd-button fd-button is-disabled" type="button">Disabled Focusable</button>
|
|
430
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF4">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
431
|
+
<button role="button" class="fd-button fd-button--ghost">Normal State</button>
|
|
432
|
+
<button role="button" class="fd-button fd-button--ghost" aria-disabled="true" disabled>Disabled State</button>
|
|
433
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF5" class="fd-button fd-button--ghost is-disabled" type="button">Disabled Focusable</button>
|
|
434
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF5">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
435
|
+
<button role="button" class="fd-button fd-button--positive">Normal State</button>
|
|
436
|
+
<button role="button" class="fd-button fd-button--positive" aria-disabled="true" disabled>Disabled State</button>
|
|
437
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF6" class="fd-button fd-button--positive is-disabled" type="button">Disabled Focusable</button>
|
|
438
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF6">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
439
|
+
<button role="button" class="fd-button fd-button--negative">Normal State</button>
|
|
440
|
+
<button role="button" class="fd-button fd-button--negative" aria-disabled="true" disabled>Disabled State</button>
|
|
441
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF7" class="fd-button fd-button--negative is-disabled" type="button">Disabled Focusable</button>
|
|
442
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF7">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
443
|
+
<button role="button" class="fd-button fd-button--attention">Normal State</button>
|
|
444
|
+
<button role="button" class="fd-button fd-button--attention is-disabled" aria-disabled="true" disabled>Disabled State</button>
|
|
445
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF8" class="fd-button fd-button--attention is-disabled" type="button">Disabled Focusable</button>
|
|
446
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF8">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### Focusable disabled
|
|
450
|
+
|
|
451
|
+
The disabled button can be focusable by adding the \
|
|
452
|
+
|
|
453
|
+
```html
|
|
454
|
+
<button role="button" aria-disabled="true" aria-describedby="fd-ONXuqucVcF" class="fd-button is-disabled" type="button">Disabled Focusable</button>
|
|
455
|
+
<p aria-live="assertive" class="fd-button__instructions" id="fd-ONXuqucVcF">This disabled button is focusable and this text will be read out by a screen reader and read again when there are changes to the state of the button.</p>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
## Accessibility
|
|
459
|
+
|
|
460
|
+
- Use semantic HTML elements where appropriate
|
|
461
|
+
- Include proper ARIA attributes for interactive elements
|
|
462
|
+
- Ensure keyboard navigation support
|
|
463
|
+
- Provide adequate color contrast
|
|
464
|
+
|
|
465
|
+
## Source
|
|
466
|
+
|
|
467
|
+
This documentation was automatically generated from: `packages/styles/stories/Components/button/button.stories.js`
|
|
468
|
+
|
|
469
|
+
For the latest updates and interactive examples, see [Storybook](https://sap.github.io/fundamental-styles/).
|