Auto-fill a box with arbitrary text by fitting it into a container of specified width and height. Version 1.0.0, released as an early-stage library with no unit tests (only e2e) and a prototypical codebase. Key differentiators: reactive state for watching fit changes, multi-format builds (ES2015 source, ES5 commonjs, commonjs2, global). Current status: active but early development, author notes not accepting PRs due to prototypical state. Supports min/max font size options, custom font weight, and line-by-line fitting.
npm install fontfillNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create an AutoFittingText instance for a div, compute best-fit font size, and apply it.
Consider alternative libraries like textfit or fitty for production use.
Ensure dimensions are numbers (e.g., element.clientWidth, element.clientHeight).
Use a number like 1.2 instead of '1.2em' or '1.2' as a string.
Verify container has layout dimensions: console.log(width, height) before instantiation.
Use 'fontfill' for bundled builds, or configure bundler to handle ES module imports.
No dependency data recorded yet.