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

StarBorder

star-border

Animates star-like highlights around a content border.

Usage

Basic usage

The default rendering is a button, with the upper and lower meteor light strips sweeping back and forth along the stroke; the light strip color is primary token.

tsx
<StarBorder>Start now</StarBorder>

Custom color

color Feed radial-gradient, you can pass any CSS color or token.

tsx
<StarBorder color="var(--color-chart-3)">Limited time event</StarBorder>

Speed and thickness

speed The smaller it is, the more active it is; thickness spreads the upper and lower padding to determine the stroke thickness.

tsx
<StarBorder speed={3} thickness={2}>
  Highly active
</StarBorder>

Polymorphic rendering (as)

as="a" is rendered as a link, and the DOM attribute is transparently passed to the element.

View document →
tsx
<StarBorder as="a" href="/docs" color="var(--color-chart-2)">
  View document →
</StarBorder>

When to Use

Use it when you need a CTA button/link with a glowing stroke that attracts clicks. Compared with BorderBeam/ShineBorder packages that "add border light effects to any card container", StarBorder comes with button semantics (the default rendering is <button>, and the inner shell is the button skin), which can be used directly as a button; if you just want to illuminate an existing piece of content without a button, use ShineBorder/BorderBeam.

Import

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

Props

NameTypeDefaultDescription
asElementType"button"Render root tag, "a"/"div"/any component can be passed; DOM attributes are transparently passed to the element
colorstringvar(--color-primary)Meteor light band color, fed into radial-gradient; any CSS color (hex/oklch/var(--…)) can be used
speednumber6The duration of a single meteor sweep (seconds), the bigger, the slower, the more restrained
thicknessnumber1Border light strip thickness (px), open the top and bottom padding of the root container to determine the stroke thickness
classNamestring-Forward the additional class name of the root container (merged, can cover rounded corners/spacing)
styleCSSProperties-Forward the root container inline style

Slots

SlotTypeDescription
childrenReactNodeButton/container content

Usage Guidelines

  • When customizing color token, be sure to bring the --color- prefix (such as var(--color-chart-3)). The bare var(--primary) does not resolve under Tailwind v4. See [[hulian-token-color-var-needs-color-prefix]].
  • The reduced-motion light band automatically stops (does not move but the stroke is still there), no additional processing is required.

Related

BorderBeam · ShineBorder · GlareHover · Lens · AnimatedBeam · OrbitingCircles

Playground

<StarBorder
  color="var(--color-primary)"
  speed={6}
  thickness={1}
>
  Start now
</StarBorder>
PreviousSplashCursorDecorationNextStickerPeel

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Slots
    • Usage Guidelines
    • Related
  • Playground