- Docs
- Components
- Backgrounds
- Neon Reveal
A neon tube that lights up and reveals the content below
| Name | Type | Default | Description |
|---|---|---|---|
colors | [string, string] | ["#FF9FFC", "#B163E9"] | Colour of the neon tube and of the light it pours. The light runs from the tube colour through the light colour into a deep shade of it. On light backgrounds both become pastel inks. |
backgroundColor | string | "transparent" | Background of the stage. Transparent reads the colour behind the component. |
direction | "down" | "up" | "left" | "right" | "down" | Which way the light pours. Down puts the tube on the top edge. |
expandFrom | "center" | "left" | "right" | "center" | Where the tube starts to light up before it runs across. On side tubes left is the bottom end. |
trigger | "mount" | "inView" | "manual" | "mount" | When the reveal plays. Manual waits for replay() or a click. |
revealDelay | number | 0 | Wait before the tube switches on, in milliseconds. |
revealDuration | number | 2500 | Time the light takes to run across the tube, in milliseconds. |
easing | "out" | "smooth" | "gentle" | "linear" | "out" | Timing of the sweep. Out starts fast and lands softly. |
thickness | number | 3 | Width of the tube, in pixels. |
glow | number | 1 | Size and strength of the halo around the tube. |
spill | number | 1 | Brightness of the light the tube pours over the content. |
reach | number | 1 | How far that light travels before it fades out. |
intensity | number | 1 | Overall exposure of the tube and its light. |
feather | number | 0.15 | Softness of the reveal edge, as a share of the frame. |
inset | number | 24 | Distance of the tube from its edge, in pixels. |
length | number | 0.9 | Length of the tube, as a share of the frame. Shorter tubes show their rounded ends. |
mirrored | boolean | false | Adds a second tube on the opposite edge, pouring the other way. |
hum | number | 1 | Gentle breathing of the lit tube. |
flicker | number | 1 | How hard the tube stutters as it switches on. 0 fades it on cleanly. |
interactive | boolean | true | Click to re-ignite: the light cuts out, the tube stutters back on and the reveal plays again. Clicks during a reveal make it flicker. Links and buttons in the content are ignored. |
intro | boolean | true | Plays the reveal. Off shows the content and the lit tube at once. |
paused | boolean | false | Freezes the motion. Reduced-motion users get the revealed state as a still frame. |
dpr | number | 2 | Maximum device pixel ratio for the canvas. |
scrollThreshold | number | 0.3 | Share of the component that must be visible for the inView trigger. |
onStart | () => void | undefined | Called each time the tube switches on. |
onComplete | () => void | undefined | Called each time a reveal finishes. |
children | ReactNode | undefined | Content revealed under the light, centred in the frame. |
ref | { replay } | undefined | replay() switches the tube off and plays the reveal again. |
className | string | undefined | Classes for the root, which fills its parent. |
style | CSSProperties | undefined | Inline styles for the root element. |
colors[string, string]Colour of the neon tube and of the light it pours. The light runs from the tube colour through the light colour into a deep shade of it. On light backgrounds both become pastel inks.
["#FF9FFC", "#B163E9"]backgroundColorstringBackground of the stage. Transparent reads the colour behind the component.
"transparent"direction"down" | "up" | "left" | "right"Which way the light pours. Down puts the tube on the top edge.
"down"expandFrom"center" | "left" | "right"Where the tube starts to light up before it runs across. On side tubes left is the bottom end.
"center"trigger"mount" | "inView" | "manual"When the reveal plays. Manual waits for replay() or a click.
"mount"revealDelaynumberWait before the tube switches on, in milliseconds.
0revealDurationnumberTime the light takes to run across the tube, in milliseconds.
2500easing"out" | "smooth" | "gentle" | "linear"Timing of the sweep. Out starts fast and lands softly.
"out"thicknessnumberWidth of the tube, in pixels.
3glownumberSize and strength of the halo around the tube.
1spillnumberBrightness of the light the tube pours over the content.
1reachnumberHow far that light travels before it fades out.
1intensitynumberOverall exposure of the tube and its light.
1feathernumberSoftness of the reveal edge, as a share of the frame.
0.15insetnumberDistance of the tube from its edge, in pixels.
24lengthnumberLength of the tube, as a share of the frame. Shorter tubes show their rounded ends.
0.9mirroredbooleanAdds a second tube on the opposite edge, pouring the other way.
falsehumnumberGentle breathing of the lit tube.
1flickernumberHow hard the tube stutters as it switches on. 0 fades it on cleanly.
1interactivebooleanClick to re-ignite: the light cuts out, the tube stutters back on and the reveal plays again. Clicks during a reveal make it flicker. Links and buttons in the content are ignored.
trueintrobooleanPlays the reveal. Off shows the content and the lit tube at once.
truepausedbooleanFreezes the motion. Reduced-motion users get the revealed state as a still frame.
falsedprnumberMaximum device pixel ratio for the canvas.
2scrollThresholdnumberShare of the component that must be visible for the inView trigger.
0.3onStart() => voidCalled each time the tube switches on.
undefinedonComplete() => voidCalled each time a reveal finishes.
undefinedchildrenReactNodeContent revealed under the light, centred in the frame.
undefinedref{ replay }replay() switches the tube off and plays the reveal again.
undefinedclassNamestringClasses for the root, which fills its parent.
undefinedstyleCSSPropertiesInline styles for the root element.
undefined