Skip to content

v0.7.0 — CopyableText fluid mode

Choose a tag to compare

@cpascariello cpascariello released this 05 Jun 09:54
cb2ebe6

CopyableText — fluid width-aware truncation

Adds a fluid boolean prop (default false) to CopyableText.

  • Fluid mode fills its container and truncates with a pure-CSS two-span flexbox: the last endChars characters stay pinned (fixed tail) while the head flexes and ellipsizes. Shows the full string when there's room, truncates as the container narrows. No JS measurement, no ResizeObserver, no new dependencies.
  • startChars is ignored in fluid mode; the full value is revealed via the native title attribute.
  • Fixed-mode behavior and existing callsites are unchanged — backward compatible.

Decision #98. PR #22.