Skip to main content

SignOutButton

Function SignOutButton 

Source
pub fn SignOutButton(_: SignOutButtonProps) -> Element
Expand description

Unstyled sign-out button that schedules Clerk.signOut(...).

This component renders a native <button> and treats children as button contents. For design-system buttons that own their own DOM element, call crate::use_clerk from the button’s click handler instead.

§Example

use dioxus::prelude::*;
use dioxus_clerk::*;

#[component]
fn SignOutAction() -> Element {
    rsx! {
        SignOutButton { class: "btn btn-ghost", redirect_url: "/", "Sign out" }
    }
}

§Props

For details, see the props struct definition.

  • redirect_url : Option<String>

    Full URL or path to navigate to after sign-out.

  • session_id : Option<String>

    Sign out a specific session id in multi-session applications.

  • options : SignOutOptions

    Advanced options forwarded to Clerk, as a SignOutOptions builder or a raw serde_json::Value. Explicit props win when both set the same Clerk option key.

  • disabled : bool

    Disable the generated <button>.

  • attributes : Vec<Attribute>

    Attributes spread onto the generated <button> (id, class, title, aria-*, r#type, …). r#type defaults to "button" to avoid accidental form submits.

  • onclick : Callback<MouseEvent>

    Optional click handler, called before the sign-out action is scheduled (matching Clerk React’s ordering).

  • children : Element

    Optional custom button contents. Defaults to Sign out.