StellarUI

<stellar-fit-text>

Single-line text scaler that grows or shrinks text to fit the available width, following the component's text-only contract.

Properties

Component
Example
rem

Preview

The component keeps one line of text on a single line by scaling it to the available width.

Constrained width
The cute gray kitten jumped into the flower pot

Markup

Copy
<stellar-fit-text>The cute gray kitten jumped into the flower pot</stellar-fit-text>

API

Complete props, events, slots, and implementation notes for the shipped fit-text surface.

Props

PropTypeDefaultNotes
min-font-sizenumber1
max-font-sizenumber128
precisionnumber0.1

Events

EventSourceNotes

Slots

SlotNotes
defaultOne or more text nodes to display. Non-text nodes are ignored.

Notes

  • The public tag is `stellar-fit-text`, matching the component's one-line text scaler rather than a generic text container.
  • The component only reads text nodes from the default slot. Nested elements are ignored on purpose so the fit measurement stays deterministic.
  • A ResizeObserver keeps the text fitted as the host width changes.
  • `min-font-size`, `max-font-size`, and `precision` are the entire public API surface.
  • The host exposes a `resize()` method for late-loading font cases where you need to force another measurement after typography changes.