Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Backgrounds

  • DotPattern
  • GridPattern
  • StripedPattern
  • Spotlight
  • FadeMask
  • RetroGrid
  • Ripple
  • Meteors
  • Aurora
  • Particles
  • FlickeringGrid
  • WavyBackground
  • Silk
  • Iridescence
  • Threads
  • Orb
  • LiquidChrome
  • Balatro
  • Ballpit
  • Beams
  • ColorBends
  • DarkVeil
  • Dither
  • DotField
  • EvilEye
  • FaultyTerminal
  • Ferrofluid
  • FloatingLines
  • Galaxy
  • GradientBlinds
  • Grainient
  • GridDistortion
  • GridMotion
  • GridScan
  • Hyperspeed
  • LetterGlitch
  • Lightfall
  • Lightning
  • LightPillar
  • LightRays
  • LineWaves
  • LiquidEther
  • PixelBlast
  • PixelSnow
  • Plasma
  • PlasmaWave
  • Prism
  • PrismaticBurst
  • Radar
  • RippleGrid
  • ShapeGrid
  • SideRays
  • SoftAurora

Overlay Effects

  • BorderBeam
  • ShineBorder
  • GlareHover
  • Lens
  • AnimatedBeam
  • OrbitingCircles
  • ProgressiveBlur
  • CardSpotlight
  • Reveal
  • Antigravity
  • BlobCursor
  • ClickSpark
  • Crosshair
  • ElectricBorder
  • GhostCursor
  • GradualBlur
  • ImageTrail
  • LaserFlow
  • MagicRings
  • Magnet
  • MagnetLines
  • MetaBalls
  • MetallicPaint
  • OrbitImages
  • PixelTrail
  • PixelTransition
  • Ribbons
  • ShapeBlur
  • SplashCursor
  • StarBorder
  • StickerPeel
  • TargetCursor
  • Cubes
  • Tilt
  • BorderGlow
  • GlassIcons
  • GlassSurface
  • Lanyard
  • ModelViewer
  • FluidGlass

FadeMask

fade-mask

Fades content out to transparency toward one edge or from the center outward.

Usage

Fade out the bottom

For a bleeding showcase wall or a truncated long list: the bottom fades to transparency and works on any background.

tsx
<FadeMask direction="bottom" start="60%">
  …
</FadeMask>

Spotlight a texture center

direction="radial" fades outward from at: a dot or grid background that is bright at the center and recedes toward the edges.

tsx
<FadeMask direction="radial" at="30% 20%" size="50% 60%" className="absolute inset-0">
  <DotPattern />
</FadeMask>

When to use

Fading out the bottom of a bleeding showcase wall, spotlighting the center of a dot or grid texture, or fading both ends of a horizontal scroller. It uses a CSS mask, so it doesn't care what background sits underneath and works on cards and dark sections alike. For a blur gradient use ProgressiveBlur; for a glow use Spotlight.

Import

ts
import { FadeMask } from "@hulianui/ui"

Props

NameTypeDefaultDescription
direction"top" | "bottom" | "left" | "right" | "radial""bottom"Which edge to fade toward; radial fades outward from at
startstring"60%" (radial "0%")Linear: where the fade begins (fully opaque before it). Radial: the share of the radius that stays fully opaque
atstring"50% 50%"Radial: the center of the fade
sizestring"50% 50%"Radial: the extent of the fade (width height)
Extends native <div> attributes (use className for positioning and size).

Slots

SlotTypeDescription
childrenReactNodeThe content to fade

Pitfalls

  • The mask applies to the whole subtree: clickable elements stay clickable even where they've faded to transparent, so keep interactive controls out of the fully transparent part.
  • When wrapping an absolute inset-0 background such as DotPattern, give FadeMask its own position and size (for example absolute inset-0); otherwise the background aligns to an outer positioned ancestor.

Related

Spotlight · DotPattern · ProgressiveBlur

Playground

<FadeMask direction="bottom">
  …
</FadeMask>
PreviousSpotlightDecorationNextRetroGrid

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Slots
    • Pitfalls
    • Related
  • Playground