[ Actions ]
MeshButton
A standalone button lit by four soft radial colors. Pick a preset or your own colors, then control strength, reach, glow, border, radius and motion. Works in light and dark mode.
Import#
import { MeshButton } from 'reusify-ui';When to use#
- One standout action on a landing page or hero: Get started, Send, Upgrade.
- Use it sparingly. For everyday actions, use Button.
Examples#
Playground#
Every control, shown in light and dark side by side. The code updates as you change it.
<MeshButton
variant="mesh"
preset="holo"
intensity={1}
size="lg"
rightIcon={<FiSend />}
>
Get Started
</MeshButton><MeshButton rightIcon={<FiSend />}>Get Started</MeshButton>Variants#
mesh is a bright, borderless fill with a soft inner glow, and looks the same in both themes. glow and outline sit on the theme surface, so they change with it.
<MeshButton variant="mesh" preset="sky">Get Started</MeshButton>
<MeshButton variant="glow" preset="ember">Get Started</MeshButton>
<MeshButton variant="outline" preset="sunset">Get Started</MeshButton>Presets#
<MeshButton preset="holo" /> {/* holo · sky · mint · sunset · ocean · ember · rainbow */}Your own colors#
colors goes left, top right, bottom right, bottom. Pass fewer and the rest come from the preset. radius makes it a rounded rectangle.
<MeshButton
size="lg"
radius={16}
colors={['#F7CBBF', '#CDAFFA', '#81A9F8', '#A4FCF5']}
rightIcon={<BsSendFill />}
>
Send
</MeshButton>
<MeshButton variant="glow" preset="ocean" glow={0.8}>Outer glow</MeshButton>Animation#
Off by default. Add animate to any variant: on its own it means flow, or name a mode. speed sets the seconds per loop.
<MeshButton animate>Flow</MeshButton>
<MeshButton variant="outline" animate="border">Border</MeshButton>
<MeshButton variant="glow" animate="pulse">Pulse</MeshButton>
<MeshButton animate="shimmer" speed={2}>Shimmer</MeshButton>API reference#
<MeshButton />
Also accepts every native <button> attribute, or <a> attributes when href is set. Forwards its ref.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'mesh' | 'glow' | 'outline' | 'mesh' | Bright fill, colored light on the surface, or a gradient border. |
preset | 'holo' | 'sky' | 'mint' | 'sunset' | 'ocean' | 'ember' | 'rainbow' | 'holo' | Starting palette. Also exported as meshPresets. |
colors | string[] | - | Up to four colors: left, top right, bottom right, bottom. |
intensity | number (0–1) | 1 / 0.7 / 0.14 | Color strength, by variant. |
spread | number | 1 | How far each color reaches. |
glow | number (0–1) | 0 | Soft light around the button. |
highlight | boolean | false | Bright spot along the bottom edge. |
borderWidth | number | string | 0 / 1 / 1.5 | Border thickness, by variant. 0 removes it. |
radius | number | string | 9999px | Corner radius. |
textColor | CSS color | - | Label and icon color. |
animate | boolean | 'flow' | 'border' | 'pulse' | 'shimmer' | false | Works on every variant. true means flow. Off under reduced motion. |
speed | number | 8 / 3 / 2.4 / 2.8 | Seconds per loop, by animate mode. |
size | 'sm' | 'md' | 'lg' | 'md' | Height and text size. |
fullWidth / iconOnly | boolean | false | Stretch, or a square icon button (give it an aria-label). |
loading / disabled | boolean | false | Shows a spinner / blocks interaction. |
leftIcon / rightIcon | ReactNode | - | Icons beside the label. |
href | string | - | Renders a link that looks like the button. |
variant'mesh''mesh' | 'glow' | 'outline'Bright fill, colored light on the surface, or a gradient border.
preset'holo''holo' | 'sky' | 'mint' | 'sunset' | 'ocean' | 'ember' | 'rainbow'Starting palette. Also exported as meshPresets.
colors-string[]Up to four colors: left, top right, bottom right, bottom.
intensity1 / 0.7 / 0.14number (0–1)Color strength, by variant.
spread1numberHow far each color reaches.
glow0number (0–1)Soft light around the button.
highlightfalsebooleanBright spot along the bottom edge.
borderWidth0 / 1 / 1.5number | stringBorder thickness, by variant. 0 removes it.
radius9999pxnumber | stringCorner radius.
textColor-CSS colorLabel and icon color.
animatefalseboolean | 'flow' | 'border' | 'pulse' | 'shimmer'Works on every variant. true means flow. Off under reduced motion.
speed8 / 3 / 2.4 / 2.8numberSeconds per loop, by animate mode.
size'md''sm' | 'md' | 'lg'Height and text size.
fullWidth / iconOnlyfalsebooleanStretch, or a square icon button (give it an aria-label).
loading / disabledfalsebooleanShows a spinner / blocks interaction.
leftIcon / rightIcon-ReactNodeIcons beside the label.
href-stringRenders a link that looks like the button.
Accessibility#
- Renders a real <button> or <a> with a visible focus ring.
- mesh keeps a dark label over a bright fill. With your own colors, check the label contrast, and use textColor if needed.
- animate stops under prefers-reduced-motion.