Skip to content
Effects / Glass / Shaders

GradientText

client24.75 kB
@stellaria/nebula-webGradientTextProps

Preview

Props

7
PropTypeDefault

children

ReactNode

—

className

Composes with the classes `Box` computes instead of replacing them.

string

—

component

The element it paints — inline, so a gradient run can sit inside a heading. Keep the text short whatever tag you pick: the clip works per line box, so a paragraph gets the whole gradient over again on every single line.

(ElementType & C)"span"

fallbackColor

The colour painted whenever the clip cannot be: no browser support, Windows forced colors, and the underline, which would otherwise be clipped away to nothing. It is not decoration — clipped text is transparent, so this is the only thing between a failed gradient and invisible text.

ColorExtended"text.primary"

gradient

A theme gradient role, or a literal `{ from, to }` pair. The role is resolved against the live theme and follows a theme switch; a literal pair is frozen where you wrote it.

{ from: ColorExtended; to: ColorExtended; deg?: number; animate?: boolean; } | GradientRole"brand"

inherit

Takes family, size, weight, line height and tracking from the parent instead of the component's own. What you want for a gradient word inside a heading, so it does not resize the line.

boolean

—

reveal

Animates the element in when it first scrolls into view. `true` takes the catalogue entrance; an object tunes it — `preset`, `distance`, `spring`, `duration`, `once`, `amount`, `rootMargin` and `index` for a stagger. It lives here rather than on each surface so that `Card`, `Paper`, `GradientBorder`, `Section` and anything else built on `Box` inherit one implementation. Without it `Box` stays a server component; with it the root swaps for a client shell and the children keep rendering on the server. The entrance is a CSS transition, not a JavaScript animation: it is the only motion in the catalogue that fires WHILE the user scrolls, and the compositor should own it.

boolean | UseRevealOptions

—

Also accepts

On top of its own props, this component forwards these groups.

Style props · 128