logout-01

logout-01 is an animated logout icon from the hugeicons-animated registry, a 24x24 outline SVG of a door with an arrow leaving it. On hover, the arrow slides and bounces, and the door outline gives a slight squash, powered by motion.

logout-01
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @hugeicons-animated/logout-01

Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { Logout01Icon } from '@/components/icons/logout-01';export function Example() {  return <Logout01Icon size={24} />;}
  • Sign-out or log-out buttons in navigation bars, user menus, and account dropdowns
  • Session-ending actions in settings, profile, or dashboard sidebars where a playful micro-interaction is wanted
  • Replacing a static logout glyph with a hover-animated version in a design system built on shadcn/ui and motion
  • Icon-only exit controls where a hover animation helps communicate the action

Examples

Sign-out button with label

A text button that pairs the animated icon with a visible label. The label keeps the action understandable without relying on the animation.

sign-out-button-with-label.tsx
import { Logout01Icon } from '@/components/icons/logout-01';export function SignOutButton() {  return (    <button type="button" className="inline-flex items-center gap-2 text-sm font-medium">      <Logout01Icon size={18} />      Sign out    </button>  );}

Trigger animation programmatically via ref

Attaching a ref switches the icon into controlled mode, so mouse events no longer auto-play the animation. startAnimation() is called on click instead.

trigger-animation-programmatically-via-ref.tsx
'use client';import { useRef } from 'react';import { Logout01Icon } from '@/components/icons/logout-01';import type { Logout01IconHandle } from '@/components/icons/logout-01';export function LogoutConfirm() {  const iconRef = useRef<Logout01IconHandle>(null);  return (    <button      type="button"      onClick={() => iconRef.current?.startAnimation()}      className="inline-flex items-center gap-2"    >      <Logout01Icon ref={iconRef} size={20} />      Log out    </button>  );}

Menu item with custom class and size

Passes className through to the wrapper div and sets a larger size for a dropdown row.

menu-item-with-custom-class-and-size.tsx
import { Logout01Icon } from '@/components/icons/logout-01';export function UserMenuLogout() {  return (    <div role="menuitem" tabIndex={0} className="flex items-center gap-3 rounded-md px-2 py-1.5 text-red-600 hover:bg-red-50">      <Logout01Icon size={20} className="shrink-0" />      <span>Logout</span>    </div>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24, so the icon scales proportionally.
classNamestring—Class name applied to the outer wrapper div (passed through cn).
refRef<Logout01IconHandle>—Forwarded ref exposing startAnimation() and stopAnimation(). Attaching a ref puts the icon in controlled mode, disabling automatic mouse-triggered animation. stopAnimation() only has an effect when the internal loops option is true, which this component does not set, so it currently does nothing.
onMouseEnterMouseEventHandler<HTMLDivElement>—Called on mouse enter of the wrapper div before the animation starts. Inherited from HTMLAttributes<HTMLDivElement>.
onMouseLeaveMouseEventHandler<HTMLDivElement>—Called on mouse leave of the wrapper div. Inherited from HTMLAttributes<HTMLDivElement>.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, role, aria-*, onClick, etc.) are spread onto the wrapper div.

Accessibility

  • The SVG has no title, aria-label, or role, so the icon is decorative by default. When it is the only content of a control, add aria-label to the button or wrap it with role="img" and an aria-label on the wrapper div.
  • Respects prefers-reduced-motion: the hook reads useReducedMotion() and skips the animation when it is set.
  • The animation is driven only by mouse enter and leave. Keyboard users get no hover state, so for focusable controls, call the ref's startAnimation() from onFocus if the feedback matters.
  • Maintain sufficient color contrast by setting the parent text color, since the stroke uses currentColor.
  • When the icon is inside an interactive element, the visible label should describe the action (for example, 'Sign out') so screen readers do not rely on the icon alone.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "logout-01" component (hugeicons-animated/logout-01) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/logout-012. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, ref, onMouseEnter, onMouseLeave, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { Logout01Icon } from '@/components/icons/logout-01';export function Example() {  return <Logout01Icon size={24} />;}```

Files & dependencies

  • icons/logout-01.tsx
  • lib/use-icon-animation.ts
dependenciesmotion

Looks similar, elsewhere