# Inputs, Filters & Forms

> Build URL-synced filter bars, interactive POST forms, selects, multi-selects, date ranges, sliders, switches and action buttons.

Collect user input, filter tables via URL query strings (`method="get"`), or submit changes to `@aiui.register_page_action()` (`method="post"`). Every input supports `auto_submit=True` for instant filtering.

## Quick catalog

| Python builder | YAML `type` | Purpose |
|---|---|---|
| `aiui.form(action, *, children, submit_label, actions, baseline_key, method, update_url)` | `form` | Groups inputs with single submit or named [`actions`](https://ui.praison.ai/docs/components/form.md#named-actions-and-draft-state) and draft tracking |
| `aiui.filter_bar(action, *, inputs, chips, defaults, reset_label, method, update_url)` | `filter_bar` | Compact auto-applying filter row with active filter chips & Reset button |
| `aiui.button_group(buttons)` | `button_group` | Action buttons (`label`, `action`, `variant`, optional payload) |
| `aiui.text_input(label, *, value, placeholder, name, auto_submit)` | `text_input` | Single-line text or search field |
| `aiui.textarea_input(label, *, value, placeholder, rows, name)` | `textarea_input` | Multi-line text editor |
| `aiui.rich_text_input(label, *, name, value, preserved_types, preserve_order, toolbar)` | `rich_text_input` | Lazy ProseMirror [rich-text editor](https://ui.praison.ai/docs/components/rich-text-input.md) with structured JSON output and protected blocks |
| `aiui.number_input(label, *, value, min_val, max_val, step, name)` | `number_input` | Numeric field with bounds & step |
| `aiui.select_input(label, *, options, value, name, searchable, options_url)` | `select_input` | Single choice dropdown (supports search & remote `options_url`) |
| `aiui.multiselect_input(label, *, options, value, name, options_url)` | `multiselect_input` | Searchable multi-select with removable chips |
| `aiui.segmented_input(name, options, *, label, value, multi)` | `segmented_input` | Pill toggle buttons (single or multi-select) |
| `aiui.radio_input(label, *, options, value, name)` | `radio_input` | Radio group |
| `aiui.checkbox_input(label, *, checked, name)` | `checkbox_input` | Boolean checkbox |
| `aiui.switch_input(label, *, checked, name)` | `switch_input` | Toggle switch |
| `aiui.slider_input(label, *, value, min_val, max_val, step, name)` | `slider_input` | Range slider |
| `aiui.date_input(label, *, value, name)` | `date_input` | Single date picker |
| `aiui.date_range_input(name, *, label, start, end, presets)` | `date_range_input` | Preset buttons (`Last 7/30/90 days`) + start/end dates |
| `aiui.time_input(label, *, value, name)` | `time_input` | Time picker |
| `aiui.color_picker_input(label, *, value, name)` | `color_picker_input` | Hex color picker |
| `aiui.tags_input(label, *, value, name, placeholder)` | `tags_input` | Free-text tag chips |
| `aiui.rating_input(label, *, value=0, max_stars=5, name, readonly, auto_submit)` | `rating_input` | Accessible star rating widget (read-only display or interactive form/RLHF input) |
| `aiui.file_upload(label, *, name="files", accept, multiple, max_size_mb, help_text, auto_submit)` | `file_upload` | Drag-and-drop file uploader (uploads via authenticated `/api/chat/attachments` and resolves safely on the server with `aiui.get_uploaded_file(...)`) |
| `aiui.file_download(label, *, href, filename, variant)` | `file_download` | Download trigger button |

## Instant URL-synced filter bar example

```python title="app.py"
import praisonaiui as aiui


@aiui.page("explorer", title="Explorer", icon="search", group="Workspace")
async def explorer(params):
    q = params.get("q", "")
    status = params.get("status", "all")
    return aiui.layout([
        aiui.filter_bar(
            "explorer",
            method="get",
            defaults={"status": "all"},
            inputs=[
                aiui.text_input("Search", name="q", value=q, placeholder="Filter by title..."),
                aiui.segmented_input("status", ["all", "active", "archived"], value=status),
            ],
        ),
        aiui.caption(f"Showing status={status!r}, query={q!r}"),
    ])
```

> **Tip:**
> With `method="get"`, active filters live in the browser URL (`/explorer?status=active&q=api`), so bookmarks, refreshes, and shared links keep the exact same view.

## Related pages

- [Filter Bar](https://ui.praison.ai/docs/components/filter-bar.md)
- [Date, Time & Date Range](https://ui.praison.ai/docs/components/date-and-time.md)
- [Form](https://ui.praison.ai/docs/components/form.md)
