leptos_struct_table/components/tbody.rs
1use crate::BodyRef;
2use leptos::prelude::*;
3
4/// Default tbody renderer. Please note that this is **NOT** a `#[component]`.
5///
6/// # Arguments
7///
8/// * `content` - The content of the renderer. It's like the children of this view.
9/// * `class` - The class attribute that is passed to the root element
10/// * `node_ref` - The `NodeRef` referencing the root tbody element.
11///
12/// This render function has to render exactly one root element.
13#[allow(non_snake_case)]
14pub fn DefaultTableBodyRenderer(
15 content: impl IntoView,
16 class: Signal<String>,
17 body_ref: BodyRef,
18) -> impl IntoView {
19 view! {
20 <tbody class=class use:body_ref>
21 {content}
22 </tbody>
23 }
24}