# Choose the right control

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/guides/choosing-controls/

Choose by the data and interaction you need, then customize appearance through styles and templates. Every control in the table is available the same way in declarative Rust and in XAML: `button()` or `Button { .. }` in `rsx!`, and `<Button />` in markup, with the same properties; the TreeDataGrid's builders come with the `treedatagrid` feature of `ferroui-view`.

| Task | Start with | Considerations |
|---|---|---|
| Trigger an action | [Button](/docs/0.5.0/controls/reference/button/) | Use a command for application logic |
| Toggle an option | [CheckBox](/docs/0.5.0/controls/reference/checkbox/) or [ToggleSwitch](/docs/0.5.0/controls/reference/toggleswitch/) | [CheckBox](/docs/0.5.0/controls/reference/checkbox/) can represent an indeterminate state |
| Choose one of a few options | [RadioButton](/docs/0.5.0/controls/reference/radiobutton/) | Use a named group for mutually exclusive choices |
| Choose from a compact list | [ComboBox](/docs/0.5.0/controls/reference/combobox/) | Preserve a meaningful selected item |
| Edit text | [TextBox](/docs/0.5.0/controls/reference/textbox/) | Set wrapping, acceptance of returns, and validation deliberately |
| Display text | [TextBlock](/docs/0.5.0/controls/reference/textblock/) | Avoid a read-only [TextBox](/docs/0.5.0/controls/reference/textbox/) for simple labels |
| Choose a numeric range value | [Slider](/docs/0.5.0/controls/reference/slider/) or [NumericUpDown](/docs/0.5.0/controls/reference/numericupdown/) | [Slider](/docs/0.5.0/controls/reference/slider/) favors approximate adjustment; numeric input favors precision |
| Show selectable records | [ListBox](/docs/0.5.0/controls/reference/listbox/) | Use templates and collection notifications |
| Show hierarchical tabular data | [TreeDataGrid](/docs/0.5.0/controls/reference/treedatagrid/) | Define row models, columns, and virtualization |
| Arrange a form | [Grid](/docs/0.5.0/controls/reference/grid/) | Use rows/columns and size constraints rather than absolute coordinates |
| Arrange a short vertical flow | [StackPanel](/docs/0.5.0/controls/reference/stackpanel/) | It measures along its stacking axis differently from a bounded [Grid](/docs/0.5.0/controls/reference/grid/) |
| Show overflow | [ScrollViewer](/docs/0.5.0/controls/reference/scrollviewer/) | Avoid nesting around an already scrolling items control |
| Reveal optional details | [Expander](/docs/0.5.0/controls/reference/expander/) | Give its header an understandable label |
| Show progress | [ProgressBar](/docs/0.5.0/controls/reference/progressbar/) | Distinguish known progress from an indeterminate wait |

A custom template changes presentation while retaining the control's behavior. A custom control changes or extends behavior. Prefer the existing control when it already supplies the necessary input, focus, selection, and accessibility model.

Browse the [complete control reference](/docs/0.5.0/controls/) or start with [layout](/docs/0.5.0/design/layout/).

## Example: choose controls for a search screen

Use a [TextBox](/docs/0.5.0/controls/reference/textbox/) for the query, a [Button](/docs/0.5.0/controls/reference/button/) for an explicit Search action, and a [ListBox](/docs/0.5.0/controls/reference/listbox/) for selectable results. Put the search row above a bounded `*` row in a [Grid](/docs/0.5.0/controls/reference/grid/). Use a [ProgressBar](/docs/0.5.0/controls/reference/progressbar/) during loading and a [TextBlock](/docs/0.5.0/controls/reference/textblock/) for empty or error messages.

If every result needs aligned columns, editing, and sorting, consider [TreeDataGrid](/docs/0.5.0/controls/reference/treedatagrid/). If each result is a short title and subtitle, keep the simpler list with a data template.

Continue with [binding](/docs/0.5.0/guides/binding/), [commands](/docs/0.5.0/guides/commands/), and [collections](/docs/0.5.0/guides/collections/) to connect these controls to the same model.

## Show an identity or page through results

- Use [**PersonPicture**](/docs/0.5.0/api/ferroui-controls/struct-personpicture/) for a photo with initials or a placeholder as fallback. Give the adjacent person label meaningful text; an avatar alone is often ambiguous. See the [PersonPicture example](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/samples/ControlCatalog/Pages/PersonPicturePage.xaml).
- Use [**PagerControl**](/docs/0.5.0/api/ferroui-controls/struct-pagercontrol/) when results come in explicit pages. Set `NumberOfPages` and read or bind the zero-based `SelectedPageIndex`; load the page data in your model. A PagerControl does not retrieve data. See the [PagerControl example](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/samples/ControlCatalog/Pages/PagerControlPage.xaml).
- Use [media controls](/docs/0.5.0/ecosystem/media/) when the content needs playback, explicit camera capture, or live QR detection.
