Displays a button or a component that looks like a button.
use leptos::*;
use crate::components::ui::button::Button;
#[component]
pub fn ButtonDemo() -> impl IntoView {
view! {
<Button>Button</Button>
}
}
The CLI is not yet available. For now, manually copy the component source into your project.
rust-shadcn-ui add button
use leptos::*;
use crate::components::ui::button::{Button, ButtonVariant};
#[component]
fn Usage() -> impl IntoView {
view! {
<Button variant=ButtonVariant::Outline>Button>/Button>
}
}
use leptos::*;
use crate::components::ui::button::Button;
#[component]
pub fn ButtonDemo() -> impl IntoView {
view! {
<Button>Button</Button>
}
}
use leptos::*;
use crate::components::ui::button::{Button, ButtonVariant};
#[component]
pub fn ButtonSecondary() -> impl IntoView {
view! {
<Button variant=ButtonVariant::Secondary>Secondary</Button>
}
}
use leptos::*;
use crate::components::ui::button::{Button, ButtonVariant};
#[component]
pub fn ButtonDestructive() -> impl IntoView {
view! {
<Button variant=ButtonVariant::Destructive>Destructive</Button>
}
}
use leptos::*;
use crate::components::ui::button::{Button, ButtonVariant};
#[component]
pub fn ButtonOutline() -> impl IntoView {
view! {
<Button variant=ButtonVariant::Outline>Outline</Button>
}
}
use leptos::*;
use crate::components::ui::button::{Button, ButtonVariant};
#[component]
pub fn ButtonGhost() -> impl IntoView {
view! {
<Button variant=ButtonVariant::Ghost>Ghost</Button>
}
}
use leptos::*;
use crate::components::ui::button::{Button, ButtonVariant};
#[component]
pub fn ButtonLink() -> impl IntoView {
view! {
<Button variant=ButtonVariant::Link>Link</Button>
}
}
use leptos::*;
use crate::components::ui::button::{Button, ButtonSize, ButtonVariant};
#[component]
pub fn ButtonIcon() -> impl IntoView {
view! {
<Button variant=ButtonVariant::Outline size=ButtonSize::Icon>
{/* <ChevronRight className="h-4 w-4" /> */}
</Button>
}
}
use leptos::*;
use crate::components::ui::button::Button;
#[component]
pub fn ButtonWithIcon() -> impl IntoView {
view! {
<Button>
{/* <Mail className="mr-2 h-4 w-4" /> */}
Login with Email
</Button>
}
}
use leptos::*;
use crate::components::ui::button::Button;
#[component]
pub fn ButtonLoading() -> impl IntoView {
view! {
<Button attr:disabled=true>
{/* <Loader2 className="mr-2 h-4 w-4 animate-spin" /> */}
Please wait
</Button>
}
}