GradientText

PreviousNext

Animated gradient sweep across live text with speed and color control.

Docs
react-bitscomponent

Preview

Loading preview…
GradientText/GradientText.css
.animated-gradient-text {
  position: relative;
  margin: 0 auto;
  display: flex;
  max-width: fit-content;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  border-radius: 1.25rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  transition: box-shadow 0.5s ease-out;
  overflow: hidden;
  cursor: pointer;
}

.animated-gradient-text.with-border {
  padding: 0.35rem 0.75rem;
}

.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
}

.gradient-overlay::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  border-radius: inherit;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: #060010;
  z-index: -1;
}

.text-content {
  display: inline-block;
  position: relative;
  z-index: 2;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

Installation

npx shadcn@latest add @react-bits/GradientText-JS-CSS

Usage

import { GradientTextJSCSS } from "@/components/GradientText-JS-CSS"
<GradientTextJSCSS />