# register_component

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

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

```rust
fn register_component<E: crate::IntoElement>(name: &str, view: impl Fn() -> E + 'static)
```

Registers the element `view` makes under `name`, for the `Component`
property of a [`ComponentHost`](/docs/0.5.0/api/ferroui-view/prelude/struct-componenthost/) (`<view:ComponentHost Component="Counter"/>`
in XAML).

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

## Availability

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