You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-2Lines changed: 42 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
# Protohiro Effects
2
2
3
-
Protohiro Effects is a zero-wrapper React library for hard CSS effects like gradient borders, glass highlights, glow rings, noise overlays, and spotlight overlays.
3
+
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.
4
+
5
+
Built for design systems and app UIs that need premium effects without extra DOM nodes, layout shifts, or runtime layout measurements.
Most visual effects are easy to prototype and annoying to ship. Hand-rolled CSS often turns into:
37
+
38
+
- extra wrapper elements
39
+
- pseudo-element conflicts
40
+
- broken `border-radius` clipping
41
+
- SSR and hydration edge cases
42
+
- Safari-specific fallback work
43
+
44
+
Protohiro Effects packages those effects as React hooks that mutate only `classList` and CSS custom properties on a single existing element.
45
+
46
+
## Best-fit use cases
47
+
48
+
-`react gradient border` without wrappers
49
+
-`react spotlight reveal effect` on cards and CTAs
50
+
-`react glass highlight` for premium dark surfaces
51
+
- CSS effects for design systems and headless UI components
52
+
- composable single-element effects that preserve refs
53
+
32
54
## Hooks
33
55
34
56
### `useGradientBorderEffect(options)`
35
57
58
+
Single-element gradient border with `border-radius` support and a graceful Safari fallback.
59
+
36
60
Options:
37
61
-`thickness?: string | number`
38
62
-`radius?: string | number`
@@ -58,6 +82,8 @@ Options:
58
82
59
83
### `useGlowEffect(options)`
60
84
85
+
Lightweight supporting glow for composition. Useful, but simpler than the core hard effects.
86
+
61
87
Options:
62
88
-`color?: string`
63
89
-`blur?: string | number`
@@ -67,13 +93,17 @@ Options:
67
93
68
94
### `useNoiseEffect(options)`
69
95
96
+
Noise overlay for textured surfaces and layered compositions.
97
+
70
98
Options:
71
99
-`size?: string | number`
72
100
-`intensity?: number`
73
101
-`disabled?: boolean`
74
102
75
103
### `useSpotlightEffect(options)`
76
104
105
+
Interactive spotlight and reveal effect for premium cards, media, and CTA surfaces.
106
+
77
107
Options:
78
108
-`mode?: 'glow' | 'reveal'`
79
109
-`size?: string | number`
@@ -94,6 +124,16 @@ Options:
94
124
95
125
`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.
96
126
127
+
## Positioning
128
+
129
+
This library is strongest when you need effects that are awkward to ship by hand:
130
+
131
+
- gradient borders with correct clipping
132
+
- spotlight reveal overlays
133
+
- subtle glass highlights on existing components
134
+
135
+
`glow` and `noise` are supporting effects. The main value is shipping the harder UI effects safely on a single element.
136
+
97
137
## Composability
98
138
99
139
Hooks are composable because each effect writes only namespaced classes (`pe-*`) and CSS variables (`--pe-*`).
Copy file name to clipboardExpand all lines: packages/core/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
Core runtime utilities used by `@protohiro/effects`.
4
4
5
+
This package exists for the single-element runtime layer: style injection, class mutation, CSS variable mutation, and ref composition helpers for zero-wrapper effects.
Copy file name to clipboardExpand all lines: packages/react/README.md
+30-3Lines changed: 30 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,15 @@
1
1
# @protohiro/effects
2
2
3
-
Zero-wrapper React hooks for composable CSS effects.
3
+
React hooks for hard CSS effects on existing elements without wrappers.
4
+
5
+
Best for:
6
+
7
+
-`react gradient border`
8
+
-`react spotlight reveal effect`
9
+
-`react glass highlight`
10
+
- composable effects in design systems
11
+
12
+
The library targets effects that are awkward to ship by hand because of pseudo-elements, `border-radius`, Safari fallback behavior, SSR, and ref composition.
4
13
5
14
## Install
6
15
@@ -19,6 +28,14 @@ export function Button() {
19
28
}
20
29
```
21
30
31
+
## Why use it
32
+
33
+
- no extra DOM nodes
34
+
- no layout measurements
35
+
- SSR and hydration friendly
36
+
- preserves existing refs and class names
37
+
- effects compose through namespaced classes and CSS variables
38
+
22
39
## Hooks
23
40
24
41
-`useGradientBorderEffect`
@@ -27,6 +44,16 @@ export function Button() {
27
44
-`useNoiseEffect`
28
45
-`useSpotlightEffect`
29
46
47
+
## Core effects
48
+
49
+
### `useGradientBorderEffect(options)`
50
+
51
+
Gradient border ring on a single existing element with `border-radius` support and graceful fallback behavior.
52
+
53
+
### `useSpotlightEffect(options)`
54
+
55
+
Interactive spotlight and reveal overlay for cards, media surfaces, and CTA blocks.
56
+
30
57
### `useGlassHighlightEffect(options)`
31
58
32
59
Adds a restrained glass highlight layer with edge light, soft sheen, tint, and optional backdrop blur for dark premium surfaces.
0 commit comments