Stroke Scribble Fill Button
Hovering draws one thick zigzag stroke across a pill button that grows wider as it goes, and moving away retraces it. A crayon variant fills with diagonal hatching and paper grain. Skia on React Native, CanvasKit on web.
export function Example() {
const progress = useSharedValue(0);
…
Agent prompt
Add the Now In Code component "stroke-scribble-fill-button" to this project. The full source is attached at the end of this prompt. Put the files under components/stroke-scribble-fill-button/, install the listed dependencies with `npx expo install`, and render it on a route I can open. Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply. === Source files are attached here for paid plans ===
Details
- Platforms
- iOS, Android, Web
- Requires
- Expo SDK 54+
- Access
- Pro
- Updated
- 9 Oct 2026
- License
- Unlimited commercial projects
- Original design
- @hiteshxdev on X
Are you the designer? Ask us to change or remove this.
Add pieces from the terminal or let your agent fetch them. Until then, Copy prompt does the same job. Docs
What it does
A small pill button with a dark label. Pressing it, or hovering with a pointer, draws a thin diagonal stroke appears at the left, then a zigzag of connected strokes marches to the right while the line thickens, until the pill is solid blue. Letting go retraces the path in reverse and thins it out again, and releasing mid-fill reverses from the current progress. The label stays dark the whole time. A second crayon variant fills with hatched wax strokes that overlap darker, with a rough edge and a paper-grain texture.
How it's built
Both looks are Skia paths. The plain variant is one long zigzag path with a trim end and a stroke width that both depend on a single progress value. The crayon variant stacks many seeded hatch strokes and three wavy touch-up passes, adds a discrete path effect for the rough edge, and cuts paper holes and waxy streaks with an SkSL noise shader. Reanimated drives the progress with a timed ease, and the same core file produces the geometry for the web preview in CanvasKit. A progress prop pins the fill for screenshots.
Good for
- Call-to-action buttons on a marketing or portfolio screen
- Chips or tabs that need a hand-drawn selection state
- A playful variant of a standard filled button in a creative app
Dependencies
@shopify/react-native-skiareact-native-reanimatedreact-native