JSX style props for applying text gradients using Cerberus tokens
Text gradients allow you to apply beautiful gradient effects to text content using Cerberus gradient tokens. This is based on the PandaCSS text gradients documentation.
Use the textGradient prop to apply a gradient to text. The gradient tokens follow the pattern [theme].[mode].[variant].
import { Text } from '@cerberus-design/react'
function Example() { return ( <Text textGradient="cerberus.dark.charon-dark"> This text has a gradient effect </Text> )}The Cerberus factory provides a convenient way to apply text gradients with inline styles:
import { cerberus } from '@cerberus-design/react'
function Example() { return ( <cerberus.span textGradient="cerberus.dark.charon-dark"> This is gradient text using the factory </cerberus.span> )}Here are some examples of text gradients in action:
Cerberus provides several gradient variants, each available in light and dark modes:
charon-light / charon-darknyx-light / nyx-darkamphiaraus-light / amphiaraus-darkstyx-light / styx-darkthanatos-light / thanatos-darkhades-light / hades-darkasphodel-light / asphodel-darkFor theme-aware gradients, you can use conditional styles directly on the cerberus factory:
import { cerberus } from '@cerberus-design/react'
function Example() { return ( <cerberus.span display="block" _cerberusTheme={{ textGradient: 'cerberus.dark.charon-dark', }} _acheronTheme={{ textGradient: 'acheron.dark.charon-dark', }} > Theme-aware gradient text </cerberus.span> )}| Prop | CSS Property | Token Category |
|---|---|---|
textGradient | background-image, background-clip | gradients |
background-image with background-clip: text to achieve the effectOn this page