# builder

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/builder/

**module** · [`ferroui-view`](/docs/0.5.0/api/ferroui-view/) · v0.5.0

```rust
module builder
```

The builders of elements: [`El`](/docs/0.5.0/api/ferroui-view/builder/struct-el/), the element of a control class, its
methods, and the conversions of what a setter takes ([`IntoProp`](/docs/0.5.0/api/ferroui-view/builder/trait-intoprop/)).

Every class gets a function that starts its element (`button()`) and a
trait with a setter per property and a handler per routed event
(`ButtonProps`), generated from the sources (`generated/builders.rs`). The
setters take what converts to the value of the property: the value, a
value that converts to it (`"text"` for an optional string, `8.0` for a
thickness), a [`Signal`](/docs/0.5.0/api/ferroui-view/reactive/struct-signal/) or a [`Memo`](/docs/0.5.0/api/ferroui-view/reactive/struct-memo/) (the property follows it), a
closure (computed reactively), a two-way signal, a binding, or an element
for a property that holds an object (`content`).

What the upstream API writes with indexers and operators on properties is
here a method of the element:

| upstream C#                                   | builder                                      |
|-----------------------------------------------|----------------------------------------------|
| `control[Grid.RowProperty] = 1`               | `.set(Grid::row_property(), 1)` or `.grid_row(1)` |
| `control[!TextBlock.TextProperty] = binding`  | `.bind(TextBlock::text_property(), binding)` |
| `control.Bind(Prop, observable)`              | `.text(signal)`, `.text(move \|\| ..)`        |
| `!!` / two-way binding                        | `.text(signal.two_way())`                    |
| `control.Classes.Add("accent")`               | `.class("accent")`                           |
| `control.Name = "x"`                          | `.name("x")`                                 |

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/builder.rs#L1)

## Contents

- [`markers`](/docs/0.5.0/api/ferroui-view/builder/markers/) — module
- [`ViewClass`](/docs/0.5.0/api/ferroui-view/builder/trait-viewclass/) — trait
- [`Builder`](/docs/0.5.0/api/ferroui-view/builder/trait-builder/) — trait
- [`TypedProperty`](/docs/0.5.0/api/ferroui-view/builder/trait-typedproperty/) — trait
- [`IntoValue`](/docs/0.5.0/api/ferroui-view/builder/trait-intovalue/) — trait
- [`FromValue`](/docs/0.5.0/api/ferroui-view/builder/trait-fromvalue/) — trait
- [`IntoProp`](/docs/0.5.0/api/ferroui-view/builder/trait-intoprop/) — trait
- [`Bind`](/docs/0.5.0/api/ferroui-view/builder/struct-bind/) — struct
- [`El`](/docs/0.5.0/api/ferroui-view/builder/struct-el/) — struct
- [`ElementBuilder`](/docs/0.5.0/api/ferroui-view/builder/trait-elementbuilder/) — trait

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
