A button with a ripple effect that animates when clicked.
npx shadcn@latest add https://www.uicart.io/registry/animated-button.json
import AnimatedButton from "@/components/ui/animated-button";
<AnimatedButton
startContent={<LogInIcon className="size-4 mr-2" />}
>
User Login
</AnimatedButton>
You can show a loading state by passing the isLoading
prop. By default, the loading state is false.
<AnimatedButton isLoading>Button Text</AnimatedButton>
You can disable the click effect by passing the showClickEffect
prop. By default, the click effect is enabled.
<AnimatedButton showClickEffect={false}>Button Text</AnimatedButton>
You can add an icon to the button by passing the startContent
or endContent
prop. By default, the icon is null.
<AnimatedButton
startContent={<LogInIcon className="size-4 mr-2" />}
>
User Login
</AnimatedButton>
You can pass all the props of the Button
component from Shadcn to the AnimatedButton
component.
<AnimatedButton
variant="desctructive"
size="lg"
>
User Login
</AnimatedButton>