Components
← All components

Nested Form

stimeo--nested-form

Adds and removes rows in a form, submitted the way Rails nested attributes expect.

  • Core
  • Rails / Turbo

Adds rows to a form by cloning your template, numbering them so their names never collide. Removing takes an unsaved row straight out, while a row that has already been saved is marked for deletion and hidden, so submitting lets Rails destroy it. The row state lives only in the page, so a Turbo swap simply counts them again. Adding moves focus to the start of the new row and removing moves it to the neighbouring one, so the keyboard never loses its place. How many rows there are can be announced, and you can set a minimum and a maximum. It ships no markup and no CSS.

running

Keyboard

This component has no keyboard interactions of its own.