Skip to content
Back

Expandable textPro

Long text clamped to a few lines with a soft fade; Read more glides open, Show less closes, and the toggle only appears when the text overflows.

oxyn add expandable-text

The agent read 14 files, ran the test suite three times and traced the flaky failure to a clock skew in the token validator: tokens minted in the last second of a minute were rejected when the check ran a few milliseconds later.

The fix adds a 30 second leeway to the expiry check and a regression test that freezes the clock at 59.999 seconds. All 148 tests pass, including the new one, across three consecutive runs.

No other call sites depend on the strict check. The change is two lines in auth/token.rs and one new test.

The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • Long run summaries, descriptions and message bodies that should not push everything else down.

When not to use

Installation

Expandable text is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add expandable-text

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Summary

A run summary clamped to three lines.

The agent read 14 files, ran the test suite three times and traced the flaky failure to a clock skew in the token validator: tokens minted in the last second of a minute were rejected when the check ran a few milliseconds later.

The fix adds a 30 second leeway to the expiry check and a regression test that freezes the clock at 59.999 seconds. All 148 tests pass, including the new one, across three consecutive runs.

No other call sites depend on the strict check. The change is two lines in auth/token.rs and one new test.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

One line

One line without the fade.

The agent read 14 files, ran the test suite three times and traced the flaky failure to a clock skew in the token validator: tokens minted in the last second of a minute were rejected when the check ran a few milliseconds later.

The fix adds a 30 second leeway to the expiry check and a regression test that freezes the clock at 59.999 seconds. All 148 tests pass, including the new one, across three consecutive runs.

No other call sites depend on the strict check. The change is two lines in auth/token.rs and one new test.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Labels

Custom labels.

The agent read 14 files, ran the test suite three times and traced the flaky failure to a clock skew in the token validator: tokens minted in the last second of a minute were rejected when the check ran a few milliseconds later.

The fix adds a 30 second leeway to the expiry check and a regression test that freezes the clock at 59.999 seconds. All 148 tests pass, including the new one, across three consecutive runs.

No other call sites depend on the strict check. The change is two lines in auth/token.rs and one new test.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

ExpandableText

PropTypeDefaultDescription
textrequiredString—The text (paragraphs split on blank lines).
linesu323Lines while collapsed.
expandedboolDefault::default()Start open.
more_labelString"Read more"Toggle label while collapsed.
less_labelString"Show less"Toggle label while open.
fadebooltrueFade over the last line.
on_changeEventHandler<bool>—Open state changed.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceOpen or close from the toggle

Accessibility

  • The clamp is visual: the whole text stays in the accessibility tree.
  • The toggle has aria-expanded and aria-controls; labels crossfade in one cell.
From the spec

The whole text stays in the accessibility tree; the toggle has aria-expanded and aria-controls; the hidden label is aria-hidden.

Motion & interaction

Height and the fade move together on a soft ease; the two labels crossfade in one cell with a short drift and blur; the chevron flips.

Timing
TransitionDurationEasingReduced motion
Open560 mscubic-bezier(.32,.5,.2,1)instant
Close420 mssameinstant
Label crossfade160–200 msease.outinstant

Responsive behaviour

  • The clamp is plain CSS, so width and font changes need no script.
Edge cases (spec)

The toggle is measured: short text never shows it. The clamp is plain CSS so resizes need no script.

Notes for AI

  • Import ExpandableText from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: ExpandableTextEl in oxyn_gpui.
  • Props to set first: text.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI