Animate Group
A wrapper for animations, made with Tailwind CSS. Works seamlessly with any children component.
animation
The only UI website
Unstyled highly composable components that you can copy/paste in your own codebase. Built with Tailwind CSS and a bit of Framer Motion. Customize them as you want.
use icons::RotateCcw; use leptos::prelude::*; use crate::components::ui::animate::{AnimateGroup, AnimateGroupItem, AnimateVariant}; use crate::components::ui::button::{Button, ButtonSize, ButtonVariant}; use crate::components::ui::headings::{H1, HeadingVariant}; // TODO DEMO. The trigger does not seem to work... 🤔 Figure out why #[component] pub fn DemoAnimateGroup() -> impl IntoView { let (_trigger, set_trigger) = signal(false); let handle_click = move || { set_trigger.update(|value| *value = !*value); }; view! { <AnimateGroup class="flex relative flex-col gap-8 items-center w-full max-w-4xl h-80"> <Button class="absolute top-0 right-0 z-10" on:click=move |_| handle_click() size=ButtonSize::Icon > <RotateCcw class="size-4" /> </Button> <AnimateGroupItem variant=AnimateVariant::FadeUp delay_ms=250> <H1 variant=HeadingVariant::Modern class="mt-6 text-center text-transparent"> "The only UI website" </H1> </AnimateGroupItem> <AnimateGroupItem variant=AnimateVariant::FadeUp class="mx-auto max-w-lg" delay_ms=450> <p class="text-base font-normal text-center text-neutral-300"> "Unstyled highly composable components that you can copy/paste in your own codebase. Built with Tailwind CSS and a bit of Framer Motion. Customize them as you want." </p> </AnimateGroupItem> <AnimateGroupItem variant=AnimateVariant::FadeUp class="space-x-4" delay_ms=600> <Button>"Components"</Button> <Button variant=ButtonVariant::Outline>"Get started"</Button> </AnimateGroupItem> </AnimateGroup> } }
Installation
You can run either of the following commands:
# cargo install ui-cli --forceui add demo__animationsui add _animations
Update the imports to match your project setup.
Copy and paste the following code into your project:
components/ui/_animations.rs
#![allow(dead_code)] pub struct ANIMATIONS; impl ANIMATIONS { // Tailwind animations. pub const PULSE: &'static str = "animate-pulse"; pub const PING: &'static str = "animate-ping"; // Custom animations. pub const AFTER_BEAM_BORDER: &'static str = "after:animate-after_beam_border"; pub const BACKGROUND_RETRO_GRID: &'static str = "animate-background_retro_grid"; pub const BLURRY_BLOB: &'static str = "animate-blurry_blob"; pub const GRADIENT: &'static str = "animate-gradient"; pub const MARQUEE: &'static str = "animate-marquee"; pub const METEOR_EFFECT: &'static str = "animate-meteor_effect"; pub const ORBITING_CIRCLE_ITEM: &'static str = "animate-orbiting_circle_item"; pub const RADAR_SPIN: &'static str = "animate-radarSpin"; pub const RADAR_MINI: &'static str = "animate-radar_mini"; pub const TOAST_TRACKER: &'static str = "animate-toast_tracker"; pub const TYPING_EFFECT: &'static str = "animate-typing_effect"; pub const TEXT_SWIPING: &'static str = "animate-text_swiping"; pub const SPOTLIGHT_EFFECT: &'static str = "animate-spotlight_effect"; }
Update the imports to match your project setup.
Usage
// Coming soon 🦀