--- layout: default title: "FilterLiveForm" storybook_path: ra-ui-materialui-list-filter-filterliveform--with-filter-list-section --- # `` This component offers a convenient way to create a form that automatically updates the filters when the user changes its child input values. It fits nicely alongside a [``](./FilterList.md) component, but you can also use it at other places to create your own filter UI. ## Usage Use `` inside a component that provides a [`ListContext`](./useListContext.md), such as [``](./List.md). Use any React Admin [input component](./Inputs.md) as its children. Here is an example showing how you can use `` in a sidebar for the `` view, alongside a [``](./FilterList.md): {% raw %} ```tsx import * as React from 'react'; import CategoryIcon from '@mui/icons-material/LocalOffer'; import Person2Icon from '@mui/icons-material/Person2'; import TitleIcon from '@mui/icons-material/Title'; import { Card, CardContent } from '@mui/material'; import { AutocompleteInput, FilterLiveForm, DataTable, FilterList, FilterListItem, FilterListSection, List, ReferenceField, ReferenceInput, TextInput, } from 'react-admin'; const BookListAside = () => ( }> }> }> ); export const BookList = () => ( }> ); ``` {% endraw %} **Tip:** This example leverages ``, the wrapper used internally by ``, in order to obtain a consistent look and feel for the filters. ![FilterLiveForm](./img/FilterLiveForm.png) **Tip:** `` accepts multiple children, but you can also use several `` components in the same filter UI, just like we did above. **Tip:** For simple cases where you only need a text input, you can use the [``](./FilterLiveSearch.md) component, which combines that logic in a single component. ## Props Here are all the props you can set on the `` component: | Prop | Required | Type | Default | Description | | --------------- | -------- | ------------------- | -------------------- | ------------------------------------------------------------------------ | | `children` | Required | `ReactNode` | - | The children of the filter form (usually inputs) | | `formComponent` | Optional | React Component | Native HTML `
` | A React Component used to render the form | | `debounce` | Optional | `number` or `false` | 500 | The debounce delay to set the filters (pass `false` to disable debounce) | | `validate` | Optional | `function` | - | A function to validate the form values | Additional props are passed to `react-hook-form`'s [`useForm` hook](https://react-hook-form.com/docs/useform). ## `children` `` accepts any children. It simply provides the required contexts for the inputs to work as filters. ```tsx ``` ## `debounce` You can use the `debounce` prop to customize the delay before the filters are applied. The default value is `500` milliseconds. ```tsx ``` You can also disable the debounce by setting the `debounce` prop to `false`. ```tsx ``` ## `validate` Just like for [``](./Form.md), you can provide a `validate` function to validate the form values. ```tsx const validateFilters = values => { const errors: any = {}; if (!values.author) { errors.author = 'The author is required'; } return errors; }; const GlobalValidation = () => ( ); ```