Skip to content

Commit 0859d37

Browse files
authored
docs: add no truncation information on breadcrumb (#3270)
1 parent 3a35c7f commit 0859d37

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

site/src/content/docs/components/breadcrumb.mdx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ Use an ordered or unordered list with linked list items to create a minimally st
6060

6161
## Layout
6262

63+
### Breakpoints behavior
64+
6365
Breadcrumb will never wrap, the number of displayed items depends on the available width, the final two items will always be shown.
6466

6567
<Callout type="danger">
66-
**Breadcrumb items should not be this long**, the following examples are for small viewport demonstration purpose only
68+
**Breadcrumb items should not be this long**, the following examples are for small viewport demonstration purpose only.
6769
</Callout>
6870

6971
<Example code={`<nav aria-label="large breadcrumb">
@@ -83,3 +85,21 @@ Breadcrumb will never wrap, the number of displayed items depends on the availab
8385
<li class="breadcrumb-item active" aria-current="page"><span title="Very long page to show off responsiveness behavior">Very long page to show off responsiveness behavior</span></li>
8486
</ol>
8587
</nav>`} />
88+
89+
### Avoiding truncation
90+
91+
To prevent a specific item from being truncated, add `.flex-shrink-0` on the `<li>`, this could be useful for brand names like Orange which should never be truncated. The penultimate item has this option set by default so it's not useful to add it. The items will still be hidden on smaller screens.
92+
93+
<Callout type="danger">
94+
Be aware that adding this utility to all items would result in an overflow.
95+
</Callout>
96+
97+
<Example code={`<nav aria-label="very large breadcrumb with no truncation on some items">
98+
<ol class="breadcrumb">
99+
<li class="breadcrumb-item flex-shrink-0"><a href="#" title="Home">Home</a></li>
100+
<li class="breadcrumb-item flex-shrink-0"><a href="#" title="Very long subcategory to test responsive">Very long subcategory to test responsive</a></li>
101+
<li class="breadcrumb-item"><a href="#" title="Very long subcategory to test responsive 1">Very long subcategory to test responsive 1</a></li>
102+
<li class="breadcrumb-item"><a href="#" title="Very long subcategory to test responsive A">Very long subcategory to test responsive A</a></li>
103+
<li class="breadcrumb-item active" aria-current="page"><span title="Very long page to show off responsiveness behavior">Very long page to show off responsiveness behavior</span></li>
104+
</ol>
105+
</nav>`} />

0 commit comments

Comments
 (0)