Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: Truncate
section: components
---

import '../components.css';

## Elements
* **Content**: text string to truncate
* **Position**: where the text will be truncated from, ie. front, middle, or end
Expand All @@ -13,19 +15,19 @@ section: components
Truncated items are indicated by an ellipsis (...) and are used when trying to avoid multiple lines of text or when a container is being overflowed by content. Truncation should only be used when 3 or more characters are being represented and there are still at least 4 non-truncated characters displayed. Truncated items should always include a tooltip on hover, showcasing the full string sequence.
* **Breadcrumbs**: Use a breadcrumbs truncate when there isn’t enough room to display the entire breadcrumbs list, or as a way of managing relevance.

<img src="./img/breadcrumb.png" alt="image showing breadcrumbs truncation" width="353" />
<div class="ws-docs-content-img">![image showing breadcrumbs truncation](./img/breadcrumb-truncate.svg)</div>

* **Long URL's**: Use a URL truncate when the url overflows its container.

<img src="./img/longurl.png" alt="image showing long url truncation" width="442" />
<div class="ws-docs-content-img">![image showing long url truncation](./img/long-url.svg)</div>

* **Description text/alerts**: Use a truncate for description text to create more room on the page.

<img src="./img/truncatealert.png" alt="img showing alert truncate" width="632" />
<div class="ws-docs-content-img">![image showing alert truncation](./img/text-alerts.svg)</div>

* **Table inputs**: Use truncation when the data within a table overflows its container.

<img src="./img/tabletruncate.png" alt="image showing table truncate" width="397" />
<div class="ws-docs-content-img">![image showing table truncation](./img/table-truncate.svg)</div>

## Behavior
A truncate indicates that the text string has been shortened, when the user hovers a mouse over the ellipsis, the full text will be displayed as a tooltip.
Expand All @@ -35,17 +37,17 @@ Truncated items are indicated by an ellipsis (...) and are used when trying to a
### Front-line
A front-line truncate is used at the beginning of a text string to indicate the text is being continued from a previous location.

<img src="./img/frontline.png" alt="image showing table truncate" width="331" />
<div class="ws-docs-content-img">![image showing truncation at the start of a text string](./img/front-line.svg)</div>

### Mid-line
A mid-line truncate is used to shorten a text string when the end of it can’t be truncated by an ellipsis. Also used when several text strings have the exact same middle characters, but the beginning and endings vary.

<img src="./img/midline.png" alt="image showing table truncate" width="331" />
<div class="ws-docs-content-img">![image showing truncation at the middle of a text string](./img/mid-line.svg)</div>

### End-line
An end-line truncate is used at the end of a text string to shorten the sequence and indicate that there is more content located elsewhere.
<img src="./img/endline.png" alt="image showing table truncate" width="331" />

<div class="ws-docs-content-img">![image showing truncation at the end of a text string](./img/end-line.svg)</div>

## Content considerations
* If the text string is part of a link, the ellipsis should also be a part of the link.
Expand All @@ -55,6 +57,4 @@ An end-line truncate is used at the end of a text string to shorten the sequence
* When truncating text, aim to leave at least four characters un-truncated so the user understands what it is (for example, don’t truncate “demo1.internal-el6satelite” to “de…”).
* Truncate long item names if necessary.
* Avoid truncation directly before or after punctuation.
* If a table column is resizable, the truncated text should adjust accordingly.


* If a table column is resizable, the truncated text should adjust accordingly.