Skip to content

Commit

Permalink
fixup! Docs(web, web-react, web-twig): Dealing with text truncate in …
Browse files Browse the repository at this point in the history
…Breadcrumb
  • Loading branch information
literat committed Oct 17, 2023
1 parent e053399 commit e0e9b65
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/web-react/src/components/Breadcrumbs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ Use the `BreadcrumbsItem` component for the ordered list as the component's chil

### Dealing with long titles

When you need to shorten the title of the BreadcrumbsItem you can use both helper class `text-truncate` or use any of the multiple ways in JavaScript which will truncate a string for you like `.slice` or `.substring`, e. g. `str.slice(0, num) + '...'`.
You can also use any of the existing npm packages which deals with truncating the string.
When you need to shorten the title of the BreadcrumbsItem the preferred way is to use platform native helpers.
There are multiple ways in JavaScript which will truncate a string for you like `.slice` or `.substring`, e.g. `str.slice(0, num) + '…'`.

Additional option is to use helper class `text-truncate` with defined width.

You can also use any of the existing [npm packages which deal with truncating the string](https://www.npmjs.com/search?q=truncate).

For detailed information see [Breadcrumbs](https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web/src/scss/components/Breadcrumbs/README.md) component

0 comments on commit e0e9b65

Please sign in to comment.