# RainbowButton

> Animated button with a rainbow gradient border; on hover or focus a rainbow beam rides around the border with a soft halo. Other native attributes are forwarded to the rendered element.

- Package: `fancy-ui-react` (React 18/19 + Tailwind CSS v4)
- Category: Buttons
- Tags: button, animation, rainbow, gradient, cta, beam, hover, glow
- Types: `RainbowButtonProps`
- Docs: https://fancy-ui.rama.app/docs/components/rainbow-button
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/react/src/components/rainbow-button

## Import

```tsx
import { RainbowButton } from 'fancy-ui-react';
```

Setup (once per project): `npm install fancy-ui-react`, then put these lines in your main CSS file (the stylesheet import goes right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-react/tailwind.css";
```

and import the component styles once in the app entry: `import "fancy-ui-react/styles.css";`. Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in React; when one differs from the Svelte name, the Svelte name follows in parentheses. `class` becomes `className`, a callback takes the name the React port declares (`onclick` becomes `onClick`), snippets become `ReactNode` props (render functions when they take arguments) and the default snippet is `children`. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/react#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `speed` | `number` | `2` | Animation speed in seconds |
| `href` | `string` | — | Render as anchor element when provided |
| `sound` | `boolean` | `false` | Plays the press cue on activation, once the user has enabled sound |
| `type` | `"button" \| "submit" \| "reset"` | `"button"` | Native button type, ignored when rendered as an anchor |
| `disabled` | `boolean` | — | Disables the button and suppresses the press cue |
| `onClick` (Svelte `onclick`) | `(event: MouseEvent) => void` | — | Called once per activation, after the optional sound cue; never while disabled. |

## Node props

| Prop | Description |
| --- | --- |
| `children` | Button label content |

## Example

```tsx
import { RainbowButton } from "fancy-ui-react";

export function RainbowButtonExample() {
	return <RainbowButton sound>Get Started</RainbowButton>;
}
```
