| 1 |
import { Truncate } from '@patternfly/react-core'; |
| 2 |
|
| 3 |
export const TruncateLinks: React.FunctionComponent = () => { |
| 4 |
const content = 'A very lengthy anchor text content to trigger truncation'; |
| 5 |
return ( |
| 6 |
<> |
| 7 |
<div>With default width-observing truncation:</div> |
| 8 |
<div className="truncate-example-resize"> |
| 9 |
<Truncate href="#" content={content} /> |
| 10 |
<Truncate position="start" href="#" content={content} /> |
| 11 |
<Truncate position="middle" href="#" content={content} /> |
| 12 |
</div> |
| 13 |
<br /> |
| 14 |
<div>With max characters truncation:</div> |
| 15 |
<Truncate maxCharsDisplayed={15} href="#" content={content} /> |
| 16 |
<br /> |
| 17 |
<Truncate maxCharsDisplayed={15} position="start" href="#" content={content} /> |
| 18 |
<br /> |
| 19 |
<Truncate maxCharsDisplayed={15} position="middle" href="#" content={content} /> |
| 20 |
</> |
| 21 |
); |
| 22 |
}; |