Protohiro Effects is a zero-wrapper React library for hard CSS effects on existing elements: gradient borders, spotlight reveal overlays, glass highlights, glow rings, and noise overlays.
Built for design systems and app UIs that need premium effects without extra DOM nodes, layout shifts, or runtime layout measurements.
@protohiro/effects-core: shared runtime utilities.@protohiro/effects: React hooks and effect styles.@protohiro/effects-demo: local demo app.
pnpm install
pnpm buildimport { useGradientBorderEffect } from '@protohiro/effects';
function Button() {
const ref = useGradientBorderEffect({ thickness: 2, angle: 90 });
return <button ref={ref}>Click</button>;
}Most visual effects are easy to prototype and annoying to ship. Hand-rolled CSS often turns into:
- extra wrapper elements
- pseudo-element conflicts
- broken
border-radiusclipping - SSR and hydration edge cases
- Safari-specific fallback work
Protohiro Effects packages those effects as React hooks that mutate only classList and CSS custom properties on a single existing element.
react gradient borderwithout wrappersreact spotlight reveal effecton cards and CTAsreact glass highlightfor premium dark surfaces- CSS effects for design systems and headless UI components
- composable single-element effects that preserve refs
Single-element gradient border with border-radius support and a graceful Safari fallback.
Options:
thickness?: string | numberradius?: string | numbercolors?: stringangle?: string | numberdisabled?: boolean
Adds a restrained glass highlight layer tuned for premium dark surfaces.
Options:
color?: stringedgeOpacity?: numbersheenOpacity?: numbertintOpacity?: numberangle?: string | numberblur?: string | numberradius?: string | numberinset?: string | numbersaturate?: numberdisabled?: boolean
Lightweight supporting glow for composition. Useful, but simpler than the core hard effects.
Options:
color?: stringblur?: string | numberspread?: string | numberopacity?: numberdisabled?: boolean
Noise overlay for textured surfaces and layered compositions.
Options:
size?: string | numberintensity?: numberdisabled?: boolean
Interactive spotlight and reveal effect for premium cards, media, and CTA surfaces.
Options:
mode?: 'glow' | 'reveal'size?: string | numberintensity?: numbercolor?: stringsoftness?: numbercoreIntensity?: numberx?: string | numbery?: string | numberfollowPointer?: booleanrevealColor?: stringrevealImage?: stringrevealSize?: string | numberrevealOpacity?: numberdisabled?: boolean
gradient-border uses mask-composite for the preferred ring rendering path. Safari fallback uses a simplified border and layered background. The fallback keeps content readable and does not hide element content.
This library is strongest when you need effects that are awkward to ship by hand:
- gradient borders with correct clipping
- spotlight reveal overlays
- subtle glass highlights on existing components
glow and noise are supporting effects. The main value is shipping the harder UI effects safely on a single element.
Hooks are composable because each effect writes only namespaced classes (pe-*) and CSS variables (--pe-*).
pnpm lint
pnpm typecheck
pnpm test
pnpm test:visual
pnpm size