logicaffeine_web/ui/components/
chevron.rs1use dioxus::prelude::*;
5
6pub const CHEVRON_SVG: &str = r#"<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 1 8.5 6 3.5 11"/></svg>"#;
10
11pub const CHEVRON_STYLE: &str = r#"
14.chevron {
15 display: flex;
16 flex: none;
17 color: rgba(255, 255, 255, 0.6);
18 transition: transform 0.15s ease;
19}
20
21.chevron.open {
22 transform: rotate(90deg);
23}
24"#;
25
26#[component]
28pub fn Chevron(open: bool) -> Element {
29 rsx! {
30 span { class: if open { "chevron open" } else { "chevron" }, dangerous_inner_html: CHEVRON_SVG }
31 }
32}
33
34#[cfg(test)]
35#[path = "../../../../../crates/logicaffeine_tests/unit/logicaffeine_web/ui/components/chevron/tests.rs"]
36mod tests;