# Hover rotate refresh

> Refresh button whose icon rotates a full 360° on each click.

A shadcn/ui block from the [@flx](https://ui.flexnative.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/flx/button-14).

- Page, with a live preview: https://shadcn.exchange/r/flx/button-14
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/button-14-light-612fc41fe9a0c883.png
- Registry item: https://ui.flexnative.com/r/button-14.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/button-14.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `lucide-react`
- Registry items: `button`

## Files

### `registry/patterns/button/button-14.tsx`

```tsx
'use client'

import { RefreshCwIcon } from 'lucide-react'
import { useState } from 'react'

import { Button } from '@/components/ui/button'

export function Button14() {
  const [turns, setTurns] = useState(0)

  return (
    <Button variant="outline" onClick={() => setTurns((value) => value + 1)}>
      <RefreshCwIcon
        data-icon="inline-start"
        className="transition-transform duration-500 ease-in-out"
        style={{ transform: `rotate(${turns * 360}deg)` }}
      />
      Refresh
    </Button>
  )
}
```
