# LeaVerou/stretchy

Form element autosizing, the way it should be

Repository: https://github.com/LeaVerou/stretchy
Canonical: https://ross.abutalabs.com/products/stretchy
Homepage: https://stretchy.verou.me/
Language: JavaScript
License: NOASSERTION
License Family: other
Last push: 2023-12-15T06:23:35+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4057, "days_push": 992, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1273, forks 84 (observed 2026-08-28T04:04:12.694307+00:00)

## What it is
Stretchy is a tiny standalone JavaScript library that automatically autosizes HTML form controls such as textareas, text inputs, and select menus. It works via a simple script include or ESM/CJS import, requires no configuration, and adapts to dynamically added elements using mutation observers.

## Use cases
- autosize textareas to fit their content
- make text inputs grow with typed text
- resize select menus to fit their selected option
- autosize form controls added dynamically to the page
- autosize form controls inside shadow DOM web components
- restrict autosizing to specific form controls via a CSS selector

## When to choose
- you want dependency-free, tiny (<1.5KB) form autosizing
- you need autosizing to work with plain HTML without writing JavaScript
- you need it to respect existing CSS constraints like min/max width and transitions
- you use web components and need Shadow DOM support

## When to avoid
- you need a full form validation or form-building framework
- your project already uses a large UI framework with built-in autosizing components
- you need to support very old browsers not covered by v2

## Facets
- artifact type: library
- maturity: maintenance
- function: ui-components, form-handling
- domain: web-development, frontend
- platform: browser
- tags: autosizing, form-controls, vanilla-js, no-dependencies, shadow-dom, nodejs

## Member repositories
- LeaVerou/stretchy (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:12.694307+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:03:10.691859+00:00, confidence not recorded.
  - readme: https://github.com/LeaVerou/stretchy (fetched 2026-08-28T04:04:12.694307+00:00, sha f85cf4717050)
  - homepage: https://stretchy.verou.me/ (fetched 2026-08-29T12:14:29.044191+00:00, sha 20e3fb4afc26)
  - registry_npm: https://registry.npmjs.org/stretchy (fetched 2026-08-29T12:14:29.048858+00:00, sha 46085c2dfa42)
  - site_page: http://lea.verou.me/2015/07/stretchy-form-element-autosizing-the-way-it-should-be (fetched 2026-08-29T12:14:29.046803+00:00, sha 7fee3a5942ad)
- Data as of 2026-08-30T08:39:29.467469+00:00.
