nova_forms/components/
group.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use leptos::*;

use crate::QueryString;

/// A component that binds all of its contents to a part of the form data.
#[component]
pub fn Group(
    /// The query string that binds the group to the form data.
    #[prop(into)] bind: QueryString,
    /// The children of the group.
    children: Children
) -> impl IntoView {
    let (qs, form_data) = bind.form_context();

    view! {
        <Provider value=qs>
            <Provider value=form_data>{children()}</Provider>
        </Provider>
    }
}