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
Copy file name to clipboardExpand all lines: packages/documentation-site/patternfly-docs/content/components/truncate/truncate.md
+54-31Lines changed: 54 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,55 +6,78 @@ section: components
6
6
import '../components.css';
7
7
8
8
## Elements
9
-
***Content**: text string to truncate
10
-
***Position**: where the text will be truncated from, ie. front, middle, or end
11
-
***Tooltip hover**: displayes full-text string
12
-
***Ellipsis**: indicates a truncate is used
9
+
10
+
<divclass="ws-docs-content-img">
11
+

12
+
</div>
13
+
14
+
1.**Content:** A long text string that requires truncation.
15
+
2.**Ellipsis:** The truncation indicator (...) placed at the start, middle, or end of a string, depending on the [variation](#variations).
16
+
3.**Tooltip:** The message shown on hover to display the full text string.
13
17
14
18
## Usage
15
-
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.
16
-
***Breadcrumbs**: Use a breadcrumbs truncate when there isn’t enough room to display the entire breadcrumbs list, or as a way of managing relevance.
19
+
Truncated items are indicated by an ellipsis (...) and are used to reduce 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.
20
+
21
+
Truncated items should always include a tooltip on hover, showcasing the full string sequence.
22
+
23
+
### Breadcrumbs
24
+
Use a breadcrumbs truncate when there isn’t enough room to display the entire breadcrumbs list, or to manage relevance.

28
+
</div>
19
29
20
-
***Long URL's**: Use a URL truncate when the url overflows its container.
30
+
### Long URLs
31
+
Use a URL truncate when the URL overflows its container.
21
32
22
-
<divclass="ws-docs-content-img"></div>
33
+
<divclass="ws-docs-content-img">
34
+

35
+
</div>
23
36
24
-
***Description text/alerts**: Use a truncate for description text to create more room on the page.
37
+
### Description text/alerts
38
+
Use a truncate for description text to create more room on the page.

42
+
</div>
27
43
28
-
***Table inputs**: Use truncation when the data within a table overflows its container.
44
+
### Table inputs
45
+
Use truncation when the data within a table overflows its container. If a table column is resizable, the truncated text should adjust accordingly.

49
+
</div>
31
50
32
51
## Behavior
33
-
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.
52
+
A truncate component indicates that a text string has been shortened. When a user hovers over truncated text, the full text will be displayed as a tooltip.
34
53
35
54
## Variations
36
55
37
-
### Front-line
38
-
A front-line truncate is used at the beginning of a text string to indicate the text is being continued from a previous location.
56
+
### Default (end)
57
+
The default truncate is used at the end of a text string to shorten the sequence and indicate that there is more content located elsewhere.
39
58
40
-
<divclass="ws-docs-content-img"></div>
59
+
<divclass="ws-docs-content-img">
60
+

61
+
</div>
41
62
42
-
### Mid-line
43
-
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.
63
+
### Start
64
+
A start truncate is used at the beginning of a text string to indicate the text is being continued from a previous location.
44
65
45
-
<divclass="ws-docs-content-img"></div>
66
+
<divclass="ws-docs-content-img">
67
+

68
+
</div>
46
69
47
-
### End-line
48
-
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.
70
+
### Middle
71
+
A middle 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.
49
72
50
-
<divclass="ws-docs-content-img"></div>
73
+
<divclass="ws-docs-content-img">
74
+

75
+
</div>
51
76
52
77
## Content considerations
53
-
* If the text string is part of a link, the ellipsis should also be a part of the link.
54
-
* Always include hover tooltip to display the entire string to the user.
55
-
* Avoid abbreviations or truncated text in navigation items.
56
-
* Truncate text within tables where the content overflows the container. Avoid truncating table headings.
57
-
* 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…”).
58
-
* Truncate long item names if necessary.
59
-
* Avoid truncation directly before or after punctuation.
60
-
* If a table column is resizable, the truncated text should adjust accordingly.
78
+
- Include the ellipsis as part of a link when the truncated text is a link.
79
+
- Always provide a tooltip to display the entire string to the user upon hover.
80
+
- Avoid truncating navigation items.
81
+
- Truncate text within tables when it overflows the cell, but avoid truncating table headings.
82
+
- Maintain at least 4 visible characters so users can better understand content (for example, don’t truncate “demo1.internal-el6satellite” to “de…”).
83
+
- Avoid placing truncation directly before or after punctuation.
Copy file name to clipboardExpand all lines: packages/documentation-site/patternfly-docs/content/content-design/grammar/truncation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ section: content-design
4
4
subsection: grammar
5
5
---
6
6
7
-
**Truncate**, or shorten, your content whenever a string overflows the container and you don't want multiple lines of text. Typically, this is done by utilizing ellipses (...).
7
+
**Truncate**, or shorten, your content whenever a string overflows the container and you don't want multiple lines of text. Typically, this is done by utilizing ellipses (...), either manually, or via our [truncate component](/components/truncate).
8
8
9
9
For example, use truncation when a URL overflows its container:
0 commit comments