kopuz-components 0.8.1

A modern, lightweight music player built with Rust and Dioxus.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use dioxus::prelude::*;

#[component]
pub fn BackButton(on_click: EventHandler<()>, #[props(default)] class: Option<String>) -> Element {
    let layout = class.unwrap_or_else(|| "mb-6 shrink-0 self-start".to_string());
    rsx! {
        button {
            class: "flex items-center justify-center text-slate-400 hover:text-white transition-colors group {layout}",
            title: "Back",
            "aria-label": "Back",
            onclick: move |_| on_click.call(()),
            i { class: "fa-solid fa-arrow-left text-base group-hover:-translate-x-0.5 transition-transform" }
        }
    }
}