# Border Beam Button

> An outline button with a light running round it.

For the secondary action that still deserves to be found. Built on Border Beam.

- Family: Buttons
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/border-beam-button/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add border-beam-button
```

It installs to `components/galactrex/border-beam-button.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { BorderBeamButton } from "@/components/galactrex/border-beam-button";

<BorderBeamButton onClick={openDocs}>Read the docs</BorderBeamButton>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Label. |
| `duration` | `number` | `4` | Seconds per lap. |
| `length` | `number` | `0.22` | Beam length as a share of the lap. |
| `...button props` | `ButtonHTMLAttributes` | — | onClick, disabled, type and the rest. |

## Variants

- **Secondary.** Next to a solid primary button.

## Accessibility

- A real button; the beam is decorative.

## Motion

- Border Beam's single-layer rotation; pauses offscreen.
- Reduced motion: the beam holds still.
