leptos_struct_table/components/
tbody.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::BodyRef;
use leptos::prelude::*;

/// Default tbody renderer. Please note that this is **NOT** a `#[component]`.
///
/// # Arguments
///
/// * `content` - The content of the renderer. It's like the children of this view.
/// * `class` - The class attribute that is passed to the root element
/// * `node_ref` - The `NodeRef` referencing the root tbody element.
///
/// This render function has to render exactly one root element.
#[allow(non_snake_case)]
pub fn DefaultTableBodyRenderer(
    content: impl IntoView,
    class: Signal<String>,
    body_ref: BodyRef,
) -> impl IntoView {
    view! {
        <tbody class=class use:body_ref>
            {content}
        </tbody>
    }
}