# @altano/textfit

> A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.

Latest version **1.0.3** (published 2026-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @altano/textfit
pnpm add @altano/textfit
yarn add @altano/textfit
bun add @altano/textfit
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2026-11-11 |
| First published | 2022-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13 |
| Author | Alan Norbauer <alan@norbauer.com> (https://alan.norbauer.com/) |
| Maintainers | altano |
| Keywords | fit, text, textfit |

## Links

- npm: https://www.npmjs.com/package/@altano/textfit
- Repository: https://github.com/altano/npm-packages
- Homepage: https://github.com/altano/npm-packages/tree/main/packages/textfit
- npm.io page: https://npm.io/package/@altano/textfit

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.0.3 (latest) — 2026-11-11
- 1.0.2 — 2026-08-01
- 1.0.1 — 2026-03-23
- 1.0.0 — 2025-06-30
- 0.0.4 — 2024-04-01
- 0.0.3 — 2024-03-10
- 0.0.2 — 2022-09-03
- 0.0.1 — 2022-09-03

## README

# `@altano/textfit` - Hassle-Free Text Fitting

A fork of [STRML/textFit](https://github.com/STRML/textFit) (@7a1eed6db54a97798556eed3c57b2ce1f87dbab4). Has the following changes:

- Convert to ESM module
- Remove .min.js file
- Convert to TypeScript (with small code changes to accommodate)
- Make inputs stricter
- Adds the following settings to [the defaults](https://github.com/STRML/textFit#default-settings):
  ```js
  settings = {
    ...
    /**
     * Sets the final size to the max multiple of this. Useful when a font
     * requires the font size to be a multiple of a number for optimal rendering.
     */
    sizeMultipleOf: 1,
  };
  ```
- Remove the following settings (to simplify the code):
  - `alignHoriz`
  - `alignVert`

---
_Source: https://npm.io/package/@altano/textfit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
