Skip to main content

impulse_thaw/toast/
toast_body.rs

1use leptos::prelude::*;
2use thaw_components::OptionComp;
3
4#[component]
5pub fn ToastBody(
6    #[prop(optional)] toast_body_subtitle: Option<ToastBodySubtitle>,
7    children: Children,
8) -> impl IntoView {
9    view! {
10        <div class="thaw-toast-body">{children()}</div>
11        <OptionComp value=toast_body_subtitle let:subtitle>
12            <div class="thaw-toast-body__subtitle">{(subtitle.children)()}</div>
13        </OptionComp>
14    }
15}
16
17#[slot]
18pub struct ToastBodySubtitle {
19    children: Children,
20}