pub fn BackButton<F>(props: BackButtonProps<F>) -> impl IntoViewAvailable on crate feature
leptos only.Expand description
Leptos component for the native back button.
Mirrors the React SDK’s BackButton ergonomics. Drives WebApp.BackButton:
shows/hides it based on the visible signal, registers the optional click
callback, and cleans both up on unmount.
§Examples
use leptos::prelude::*;
use telegram_webapp_sdk::leptos::BackButton;
#[component]
fn App() -> impl IntoView {
let visible = RwSignal::new(true);
view! {
<BackButton
visible=visible
on_click=move || { web_sys::console::log_1(&"back".into()); }
/>
}
}§Required Props
- visible:
impl Into<Signal<bool>>- Reactive flag controlling whether the back button is shown.
§Optional Props
- on_click: [
F]- Optional callback invoked when the back button is clicked.