# ChipList Controlled Mode

The ChipList can manage its selection and data internally, or your application can control either state. Use `defaultValue` and `defaultData` to provide initial state when the component manages it.

## Controlling the Value

To set the initial selection while the ChipList manages it, set the [`defaultValue`](https://www.telerik.com/kendo-react-ui/components/buttons/api/chiplistprops#defaultValue) prop to the desired chip value.

To control the selection, pass the selected chip value or values through [`value`](https://www.telerik.com/kendo-react-ui/components/buttons/api/chiplistprops#value) and update it in the [`onChange`](https://www.telerik.com/kendo-react-ui/components/buttons/api/chiplistprops#onChange) handler. Set [`selection`](https://www.telerik.com/kendo-react-ui/components/buttons/api/chiplistprops#selection) to `single` or `multiple` to enable selection. The event's `value` contains the new selection, which you must store and pass back to the ChipList so the rendered selection stays in sync.

[Demo Source](https://demos.telerik.com/kendo-react-ui/buttons/chiplist/controlled/controlled-value/source.txt)

## Controlling the Data State

To let the ChipList manage its items, set the initial data with [`defaultData`](https://www.telerik.com/kendo-react-ui/components/buttons/api/chiplistprops#defaultdata). To control the data state:

* Store the current items in a state variable and pass them to [`data`](https://www.telerik.com/kendo-react-ui/components/buttons/api/chiplistprops#data).
* Handle [`onDataChange`](https://www.telerik.com/kendo-react-ui/components/buttons/api/chiplistprops#ondatachange) and update that state with `event.value`. This keeps the rendered items in sync with your state, so a removed Chip does not reappear on the next render.

[Demo Source](https://demos.telerik.com/kendo-react-ui/buttons/chiplist/controlled/controlled-data/source.txt)

## Suggested Links

* [ChipList Selection Mode](https://www.telerik.com/kendo-react-ui/components/buttons/chiplist/selection-mode)
* [API Reference of the ChipList](https://www.telerik.com/kendo-react-ui/components/buttons/api/chiplistprops)
