Skip to content

ArrayRemoveElementButton

Demos

Primitive elements

<Iterate.Array
value={['One', 'Two', 'Three', 'Four', 'Five']}
onChange={(value) => console.log('onChange', value)}
>
<Layout.Row>
<Field.String elementPath="/" />
<Iterate.ArrayRemoveElementButton
icon={TrashIcon}
onChange={(value) => console.log('onChange', value)}
/>
</Layout.Row>
</Iterate.Array>

Object elements

<DataContext.Provider
data={[
{
name: 'Iron Man',
},
{
name: 'Captain America',
},
{
name: 'Thor',
},
]}
onChange={(value) => console.log('onChange', value)}
>
<Iterate.Array path="/">
<Layout.Row>
<Field.String elementPath="/name" />
<Iterate.ArrayRemoveElementButton text="Remove avenger" />
</Layout.Row>
</Iterate.Array>
</DataContext.Provider>