UNPKG

react-fdt-gradient

Version:

A React component library for gradient-based designs, including text, background, and border gradients.

13 lines (12 loc) 580 B
import { jsx as _jsx } from "react/jsx-runtime"; var GradientText = function (_a) { var text = _a.text, direction = _a.direction, gradientColors = _a.gradientColors, className = _a.className; var gradient = "linear-gradient(".concat(direction, ", ").concat(gradientColors.join(', '), ")"); return (_jsx("span", { className: className, style: { background: gradient, WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', display: 'inline-block', }, children: text })); }; export default GradientText;