The `form-repeatable` web component lets developers add repeatable field groups to HTML forms with minimal markup. It handles cloning, auto-incrementing labels and IDs, add/remove buttons, min/max constraints, and full native form participation via the ElementInternals API — meaning values flow into FormData automatically, form reset works, and disabled state is respected. Supports custom button labels, pre-filled groups, fieldset-based multi-field groups, explicit `<template>` elements with `{n}` placeholders, Shadow DOM styling via CSS parts, and custom events for group add/remove. Falls back gracefully when JavaScript is unavailable.

5m read timeFrom aaron-gustafson.com
Post cover image
Table of contents
# Need customized buttons? You bet!# Already have values to show? No problem.# Need to do something more complex? I got you.# Need to constrain the responses? Sure thing.# Prefer an explicit template ? Bring it!# Here’s what you need to know about styling it# Want to hook into changes? You’re extra, but sure.# Go with the progressive enhancement flow# Demo# Grab it now
5 Impressions