This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on

Type Alias yew::html::Children

source ·
pub type Children = ChildrenRenderer<Html>;
Expand description

A type used for accepting children elements in Component::Properties.


In this example, the Wrapper component is used to wrap other elements.

html! {
        <h4>{ "Hi" }</h4>
        <div>{ "Hello" }</div>

The Wrapper component must define a children property in order to wrap other elements. The children property can be used to render the wrapped elements.

#[derive(Clone, Properties, PartialEq)]
struct WrapperProps {
    children: Children,

impl Component for Wrapper {
    // ...
    fn view(&self, ctx: &Context<Self>) -> Html {
        html! {
            <div id="container">
                { ctx.props().children.clone() }

Aliased Type§

struct Children { /* private fields */ }