# [Usage](../../../usage.md) > [Components](../basics.md) > [Form](form.md) > Repeater

Repeatable sub-form for one-to-many rows (contacts, lines, addresses) inside a [Form](form.md) schema. Use it when the number of entries is unknown at design time; use a fixed `schema` with [Input](input.md) and [Select](select.md) when the fields are always the same count, and nest another Repeater only for true sub-levels.

![image](img/repeater_1.png)

```php
@php
    $values = [
                 'input_1' => 'Example text',
                 'repeater_2' => [
                                    'input_2' => 'Text for nested input'
                                 ]
              ];
@endphp
{!!
  \KFramework\Components\Forms\Repeater::make('repeater_1')
      ->setLabel('First repeater')
      ->setSchema([
            \KFramework\Components\Forms\Input::make('input_1')
                ->setLabel('First input'),
            \KFramework\Components\Forms\Repeater::make('repeater_2')
                ->setLabel('Nested repeater')
                ->setSchema([
                    \KFramework\Components\Forms\Input::make('input_2')
                        ->setLabel('Second input'),
                ])
        ])
      ->setValues($values)
      ->setMinRows(0)
!!}
```

**End-to-end example:** order lines with product and quantity.
```php
// Blade:
{!!
  \KFramework\Components\Forms\Repeater::make('lines')
      ->setLabel('Order lines')
      ->setColumns(2)
      ->setMinRows(1)
      ->setSchema([
          \KFramework\Components\Forms\Input::make('product')->setLabel('Product')->setRequired(),
          \KFramework\Components\Forms\Input::make('qty')->setLabel('Qty')->setType('number'),
      ])
      ->setValues($orderLines ?? [])
!!}

// Controller:
use KFramework\Components\Forms\Input;
use KFramework\Components\Forms\Repeater;

$lines = Repeater::make('lines')
    ->setLabel('Order lines')
    ->setSchema([
        Input::make('product')->setLabel('Product')->setRequired(),
        Input::make('qty')->setLabel('Qty')->setType('number'),
    ])
    ->setMinRows(1);

return view('orders.edit', compact('lines'));
```

---
## Usage

- Blade:
```php
{!! \KFramework\Components\Forms\Repeater::make() !!}
```
- Controller:
```php
Repeater::make()
```

---
## Standard attributes

- `uuid`
- `id`
- `classes`
- `extraAttributes`
- `style`
- `name`
- `label`
- `schema` — row template; every added row clones these child components.
- `values` — array of row maps used to prefill existing rows.
- `defaults`
- `columns`
- `columnSpan`

See their usage and description [here](../basics.md).

---
## Component-specific attributes

### `minRows` | `->setMinRows()`  
  Minimum number of rows for the repeater to be displayed.

| Types     | Default |
|-----------|---------|
| `integer` | `1`     |


### `addable` `->setAddable()`
Set if user can add row to the repeater

| Types     | Default |
|-----------|---------|
| `boolean` | `true`  |


### `deleteable` `->setDeleteable()`
Set if user can remove row from the repeater

| Types     | Default |
|-----------|---------|
| `boolean` | `true`  |


### `sortable` `->setSortable()`
Allow the user to reorder the rows of the repeater

| Types     | Default |
|-----------|---------|
| `boolean` | `false` |

## See also
- [Components basics](../basics.md)
- [Form](form.md), [Input](input.md), [Select](select.md)
- [schema](../shared_attributes/schema.md), [values](../shared_attributes/values.md), [columns](../shared_attributes/columns.md)


### `duplicable` `->setDuplicable()`
Allow the user to duplicate a repeater row with all the data inside

| Types     | Default |
|-----------|---------|
| `boolean` | `false` |