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