view-columns
An animated view-columns icon for React that draws a rounded panel with two vertical column dividers. The dividers animate in with a staggered stroke-draw effect on hover or when controlled through a ref.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @heroicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { ViewColumnsIcon } from "@/components/ui/view-columns";export function Example() { return <ViewColumnsIcon />;}- Toolbar or table buttons that toggle column visibility or a column-layout picker
- Menu items or navigation labels where a small, animated hover cue for multi-column views adds clarity
- Settings or layout controls that need an icon with an imperative startAnimation/stopAnimation API driven by parent state
- Dashboards or data grids where a subtle, lightweight line animation should reinforce interactivity without heavy visuals
Examples
Default hover animation
Renders the icon with built-in hover animation. The dividers draw in on mouse enter and reset on mouse leave.
import { ViewColumnsIcon } from "@/components/ui/view-columns";export default function Demo() { return ( <div className="text-neutral-700"> <ViewColumnsIcon /> </div> );}Controlled animation via ref inside a button
Uses the forwarded ref to start and stop the animation from the parent button's mouse handlers. When a ref is attached, the icon's internal hover handling is disabled and the wrapper's own onMouseEnter/onMouseLeave props are invoked instead.
import { useRef } from "react";import { Button } from "@/components/ui/button";import { ViewColumnsIcon, type ViewColumnsIconHandle } from "@/components/ui/view-columns";export default function Demo() { const iconRef = useRef<ViewColumnsIconHandle>(null); return ( <Button variant="outline" onMouseEnter={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} > <ViewColumnsIcon ref={iconRef} size={18} className="mr-2" /> Columns </Button> );}Custom size and color
Sets a custom pixel size and uses Tailwind text color utilities, since the stroke is currentColor.
import { ViewColumnsIcon } from "@/components/ui/view-columns";export default function Demo() { return <ViewColumnsIcon size={32} className="text-blue-600 hover:text-blue-800" />;}API reference
Accessibility
- The icon is decorative by default. Its SVG has no title or role, so add aria-hidden="true" when a visible text label is present, or give the wrapper role="img" and an aria-label when it stands alone.
- When used as the only content of a button or link, provide an accessible name through aria-label on the interactive element, because the icon itself carries no text.
- The animation is a brief stroke draw and does not convey information on its own. Do not rely on it to communicate state; pair it with text or a state attribute such as aria-pressed or aria-expanded.
- Stroke color is inherited through currentColor, so ensure sufficient contrast against the background (WCAG 1.4.11 non-text contrast of 3:1 for meaningful icons).
- If motion sensitivity is a concern, consider disabling the animation via the controlled ref API and only calling startAnimation when the user has not requested reduced motion (prefers-reduced-motion).
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.
Use the "view-columns" component (heroicons-animated/view-columns) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/view-columns2. 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, onMouseEnter, onMouseLeave, ref, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ViewColumnsIcon } from "@/components/ui/view-columns";export function Example() { return <ViewColumnsIcon />;}```Files & dependencies
- view-columns.tsx