You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An `<sp-breadcrumbs>` shows hierarchy and navigational context for a user's location within an app. The `<sp-breadcrumbs>` component defines its list of items using child `<sp-breadcrumb-item>` elements placed in its default slot.
4
+
5
+
[View the design documentation for this component.](https://spectrum.adobe.com/page/breadcrumbs/)
2
6
3
7
### Usage
4
8
5
9
[](https://www.npmjs.com/package/@spectrum-web-components/breadcrumbs)
6
10
[](https://bundlephobia.com/result?p=@spectrum-web-components/breadcrumbs)
7
11
8
-
```
12
+
```zsh
9
13
yarn add @spectrum-web-components/breadcrumbs
10
14
```
11
15
12
16
Import the side effectful registration of `<sp-breadcrumbs>` and `<sp-breadcrumb-item>` via:
`sp-breadcrumb-item` can have a `disabled` state which disables the events from the disabled item.
36
+
- A breadcrumbs list, usually consisting of multiple [breadcrumb items](/components/breadcrumb-item), with a separator between each item.
37
+
- A breadcrumbs title at the end of the list displaying the current location within the hierarchy.
38
+
- A truncation menu may also appear, which displays all options within a breadcrumb. Within the menu, items are listed with the hierarchy ordered from the top (root) to the bottom, and will include the currently selected item. Breadcrumbs truncate when there isn't enough space to show all items, or when the list contains five or more levels. Truncation helps manage space and keep the most relevant breadcrumbs visible in deeply nested hierarchies.
When needing to optimize for functional space of `sp-breadcrumbs`, the compact option is useful for reducing the height of the breadcrumbs while still maintaining the proper user context.
52
+
When needing to optimize for functional space of `<sp-breadcrumbs>`, the `compact` property can be used to reduce the height of the breadcrumbs while still maintaining the proper user context.
50
53
51
54
```html
52
55
<sp-breadcrumbscompact>
@@ -56,34 +59,52 @@ When needing to optimize for functional space of `sp-breadcrumbs`, the compact o
56
59
</sp-breadcrumbs>
57
60
```
58
61
59
-
##Links
62
+
#### Overflowing
60
63
61
-
By default, `sp-breadcrumbs` emits a `change` event when clicking on one of its children.
62
-
However, there may be cases in which these should redirect to another page. This can be achieved by using the `href` attribute instead of `value`.
63
-
Please note that the `change` event will no longer be triggered in this case.
64
+
When space becomes limited or the maximum visible items are reached, the component automatically moves the first breadcrumbs into an action menu, adjusting dynamically as the window is resized.
65
+
66
+
By default, the maximum number of visible breadcrumbs is 4, as recommended by [Spectrum Design](https://spectrum.adobe.com/page/breadcrumbs/#Don%E2%80%99t-show-too-many-breadcrumbs-at-once). You can override this by using the `max-visible-items` attribute. The `<sp-breadcrumbs>` component will always display the action menu and the breadcrumbs title, so the minimum number of visible items is 1.
<sp-tabvalue="one-max-item">One maximum visible item</sp-tab>
87
+
<sp-tab-panelvalue="one-max-item">
80
88
81
-
When the space is limited or the maximum number of visible items is reached, the component will render the first breadcrumbs inside an action menu. If needed, the last breadcrumb item will be truncated and will render a tooltip with the full text.
As recommended by [Spectrum Design](https://spectrum.adobe.com/page/breadcrumbs/#Don%E2%80%99t-show-too-many-breadcrumbs-at-once), by default the maximum visible breadcrumbs is 4. If you want to override this, you can use the `max-visible-items` attribute.
102
+
</sp-tab-panel>
103
+
<sp-tabvalue="three-max-items">Three maximum visible items</sp-tab>
Use the "root" slot to always render the first breadcrumb item, even if the breadcrumbs are overflowing.
145
+
Use the `root` slot on the first breadcrumb item to always render the first breadcrumb item, even if the breadcrumbs are overflowing. The root will always show in addition to the number of items specified with `max-visible-items`.
The component offers the possibility to replace the action menu's icon with a custom one using the `icon` slot. Moreover, for accesibility purposes you can provide an internationalized string for the menu label using the `menu-label` attribute.
183
+
#### Links
184
+
185
+
By default, `sp-breadcrumbs` emits a `change` event when clicking on one of its children.
186
+
However, there may be cases in which clicking should redirect to another page. This can be achieved by using the `href` attribute instead of `value`.
187
+
Please note that the `change` event will no longer be triggered in this case.
The component offers the possibility to replace the action menu's icon with a custom one using the `icon` slot. Moreover, for accessibility purposes you can provide an internationalized string for the menu label using the `menu-label` attribute.
118
206
119
207
```html
120
208
<sp-breadcrumbsmenu-label="Settings">
@@ -127,3 +215,22 @@ The component offers the possibility to replace the action menu's icon with a cu
For use within an `<sp-breadcrumbs>` element, an `<sp-breadcrumb-item>` represents a single item in a list.
3
+
For use within an [`<sp-breadcrumbs>`](/components/breadcrumbs) element, an `<sp-breadcrumb-item>` represents a single item in a breadcrumbs list. The default slot contains the main content of the breadcrumb item.
4
4
5
5
### Usage
6
6
7
7
[](https://www.npmjs.com/package/@spectrum-web-components/breadcrumbs)
8
8
[](https://bundlephobia.com/result?p=@spectrum-web-components/breadcrumbs)
9
9
10
-
```
10
+
```zsh
11
11
yarn add @spectrum-web-components/breadcrumbs
12
12
```
13
13
14
14
Import the side effectful registration of `<sp-breadcrumb-item>` as follows:
Disabled breadcrumb items no longer receive focus and keyboard events.
70
+
When breadcrumbs overflow, `<sp-breadcrumbs>` will create an `<sp-breadcrumb-item>` with an [`<sp-action-menu>`](/components/action-menu) that contains the full list of breadcrumb items in reading order.
0 commit comments