Chromatic Button

A tactile button with a soft rectangular silhouette, flowing gradients and spherically projected chromatic reflections.

Controls

Preview

Example
Hover effect

Entrance

Animation
Speed (×)
Blur (px)
Rise distance (px)

Material

Color flow
Corner radius (%)
Starting color
Feather
Projection scale (deg)
Brightness
Grain

Motion

Speed
Starting phase
Seed
Paused

Button

Label
Disabled

Properties

21 properties
PropertyTypeDefaultDescription
speednumber0.7Speed of the moving reflections and color flow. Fixed color retains its hue. Zero freezes the current frame.
colorstring#b126ffStarting hue for the spectrum, fixed color, or first gradient stop. Use a hexadecimal color.
colorMode'fixed' | 'gradient-2' | 'gradient-3' | 'spectrum'spectrumKeep one fixed tint, change the whole material between two or three selected colors over time, or use the original full spectrum. Reflections keep moving; selected colors do not form stripes.
color2string#ff177cSecond gradient stop. Used in the two-color and three-color modes.
color3string#35d3ffThird gradient stop. Used only in the three-color mode.
feathernumber100Feather the projected source edges. Defaults to 100.
borderRadiusnumber50Circular corner radius as a percentage of the shorter side. Default 50 makes a wide button pill-shaped and a square button circular. The material projection and reflections adapt to the contour.
projectionScalenumber174.7Base projection angle at the default 50% corner radius. The applied angle adapts to the rounded contour; the customizer shows that applied angle. The face uses 0.7 degrees less than the rim.
intensitynumber1.4Brightness of the colored field and edge reflections.
grainnumber0.105Fine stationary texture over the color field. Zero removes the grain.
phasenumber0Offset the starting position from 0 to 100, in steps of 0.01. Pause to inspect a particular composition before exporting.
seednumber7Choose a reproducible variation of the gradient field.
pausedbooleanfalseHold the current frame. Resume continues without jumping ahead.
hoverEffect'none' | 'brighten' | 'flow' | 'spotlight'brightenHover or keyboard focus effect: none, brighten (default), gradient flow, or follow pointer. Brighten raises the light and lifts the button by 2px. Follow pointer moves and stretches the whole button with an elastic spring return, plus cursor-following reflections. Fixed colors retain their hue; disabled buttons do not react.
entrance'blur-up' | 'zoom' | 'none'blur-upMount animation: blur-up (default), zoom, or none. Configure speed, blur, rise distance and starting scale in the Entrance section. Reduced motion disables the entrance.
entranceSpeednumber1Entrance playback multiplier. Higher is faster; 1× takes 700ms for Blur + rise and 600ms for Zoom. Use Replay to preview changes.
entranceBlurnumber10Initial blur for Blur + rise, in pixels. Zero removes the blur.
entranceDistancenumber20Upward travel for Blur + rise, in pixels. Zero keeps the button in place while it fades in.
entranceScalenumber0.65Initial size for Zoom as a fraction of full size. The control displays percent; 0.65 means 65%.
childrenReactNodeGet startedButton label or icons. Provide an accessible name for icon-only buttons.
Native button props / refButtonHTMLAttributes / HTMLButtonElement—Supports onClick, disabled, type, form, aria attributes, className, style and a native button ref.

Usage

Usage
import { ChromaticButton } from './components/chromatic-button';

export function Example() {
  return (
    <ChromaticButton
      color={"#b126ff"}
      colorMode={"spectrum"}
      speed={0.7}
      paused={false}
      phase={0}
      feather={100}
      projectionScale={174.7}
      intensity={1.4}
      grain={0.105}
      seed={7}
      borderRadius={50}
      hoverEffect={"brighten"}
      entrance={"blur-up"}
      entranceSpeed={1}
      entranceBlur={10}
      entranceDistance={20}
      entranceScale={0.65}
    >
      {"Get started"}
    </ChromaticButton>
  );
}

Free for personal and commercial projects. Redistributing components, kits or templates requires permission. Read the license.