Docs
πŸ—οΈ ⏐ Components
Data
Ellipsis

Ellipsis

The Ellipsis component is designed to manage long strings of text by truncating them and optionally allowing users to expand the text to view in full. This component is particularly useful for maintaining a clean UI when dealing with potentially lengthy content such as descriptions, comments, or articles.

Quick Start

To start using the Ellipsis component, import it from the reablocks library and provide the value and limit props.

Integer a aliquet ligula. Fusce vel eros libero. Sed dictum tincidunt hendrerit. Integer id neque

Examples

Basic Usage

Expandable Text Section

In this example, the text is truncated with an ellipsis, and users can click on the ellipsis to reveal the hidden text:

Unexpandable Text Section

For cases where the full text should not be expanded within the component but is visible via a tooltip on hover:

API

The Ellipsis component offers flexibility through several properties that adjust its behavior and presentation:

PropDescriptionDefault
value *The value to ellipsis.
string
expandableWhether you can expand or not. Default: true.
boolean
true
limitLimit of characters to show. Default: 256.
number
256
titleThe title text to show on the hover.
string | false
removeLinebreaksRemove line breaks or not.
boolean
true
classNameClass name for the container.
string
themeTheme for the Ellipsis.
EllipsisTheme

Design and Usability Tips

  • Content Access: Ensure the full content is accessible through interaction (click to expand) or tooltips, preventing loss of critical information.
  • Adaptive Text: Adjust the amount of truncated text based on the context and importance, ensuring key information is always visible to the user.