Skip to main content

euv_ui/component/header/view/
fn.rs

1use super::*;
2
3/// Renders a standard header with an emoji icon, title, and subtitle.
4///
5/// Produces a consistent style banner with gradient glow effect,
6/// matching the home page design language. Every demo page uses this
7/// component as its first child.
8///
9/// # Arguments
10///
11/// - `VirtualNode<EuvHeaderProps>` - The props node containing icon, title, and subtitle.
12///
13/// # Returns
14///
15/// - `VirtualNode` - The header virtual DOM tree.
16#[component]
17pub fn euv_header(node: VirtualNode<EuvHeaderProps>) -> VirtualNode {
18    let EuvHeaderProps {
19        icon,
20        title,
21        subtitle,
22    }: EuvHeaderProps = node.try_get_props().unwrap_or_default();
23    html! {
24        div {
25            class: c_page()
26            div {
27                class: c_page_glow()
28            }
29            div {
30                class: c_page_content()
31                div {
32                    class: c_page_icon()
33                    icon
34                }
35                h1 {
36                    class: c_page_title()
37                    title
38                }
39                p {
40                    class: c_page_subtitle()
41                    subtitle
42                }
43            }
44        }
45    }
46}