From 5da50e047d6fdd3cd016f721503979c06aed47ab Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 3 May 2025 11:09:45 -0700 Subject: [PATCH] docs(truncate): improve docs --- docs/src/pages/components/Truncate.svx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/src/pages/components/Truncate.svx b/docs/src/pages/components/Truncate.svx index efa56aeb..1ea57f82 100644 --- a/docs/src/pages/components/Truncate.svx +++ b/docs/src/pages/components/Truncate.svx @@ -1,14 +1,13 @@ - -This utility component wraps the `.bx--text-truncate--*` CSS selectors from [carbon-components](https://github.com/carbon-design-system/carbon/blob/master/packages/components/src/globals/scss/_helper-classes.scss#L11) for single-line text truncation. +`Truncate` provides text truncation functionality for single-line content. It implements Carbon's text truncation CSS classes and can be used as either a component or an action. ## Default -By default, text will be clamped at the end of the line. Text is wrapped with a paragraph (`p`) element. Use the [truncate action](#usetruncate) to truncate text in other elements. +Display truncated text using the default component. Text is wrapped in a paragraph element and truncated at the end of the line. Carbon Components Svelte is a Svelte component library that implements the Carbon Design System, an open source design system by IBM. @@ -16,7 +15,7 @@ By default, text will be clamped at the end of the line. Text is wrapped with a ## Clamp front -Set `clamp` to `"front"` to clamp the text from the front. +Truncate text from the beginning by setting `clamp` to `"front"`. Carbon Components Svelte is a Svelte component library that implements the Carbon Design System, an open source design system by IBM. @@ -24,7 +23,7 @@ Set `clamp` to `"front"` to clamp the text from the front. ## use:truncate -The `truncate` action can be used on plain HTML elements. +Apply truncation to any HTML element using the `truncate` action.

Carbon Components Svelte is a Svelte component library that implements the Carbon Design System, an open source design system by IBM.