Updated
Outline then Fill
Customize
Trace1.0s
Fill0.40s
Fill delay0.80s
Stroke0.75
Text size48px
Installation
npx shadcn@latest add https://uibrik.com/r/outline-fill.jsonInstall the packages
npm install motionAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/outline-fill/outline-fill.tsx"use client"; import { cn } from "@/lib/utils"; import { motion } from "motion/react"; // `play` counts presses of a card's Change button. 0 means the card has not // been pressed yet, so every effect renders its resting state without // animating on page load. export type EffectProps = { play: number }; // Size comes from --text-effect-size (default 1.25rem, i.e. text-xl), so a // preview can enlarge every effect without changing the installed default. const SIZE = "text-[length:var(--text-effect-size,1.25rem)] leading-[1.4]"; const EASE_OUT = [0.23, 1, 0.32, 1] as const; // 06 — The outline of each letter is traced first, then the ink fills in, // like lettering sketched before it is painted. export function OutlineFill({ play, text = "Sketched, then filled", traceDuration = 1, fillDuration = 0.4, fillDelay = 0.8,
Adds the files to
components/uibrik/outline-fill and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/outline-fill.Usage
import { OutlineFill } from "@/components/uibrik/outline-fill/outline-fill";<OutlineFill play={0} text="Sketched, then filled" traceDuration={1} fillDuration={0.4} fillDelay={0.8} strokeWidth={0.75}/>Where to use Outline then Fill
Hero headlines
Letters drawn as outlines then filled give a heading a crafted entrance.
Logo reveals
Outlining then filling works well for wordmarks on intros.
Brand sites
A sketch-to-solid reveal suits design and architecture brands.
Props
OutlineFill- text
- Type string
- "Sketched, then filled"
- The copy to animate.
- traceDuration
- Type number
- 1
- Time to trace the outlines.
- fillDuration
- Type number
- 0.4
- Time for the ink to fill in.
- fillDelay
- Type number
- 0.8
- Wait before the fill starts.
- strokeWidth
- Type number
- 0.75
- Outline width.
- playrequired
- Type number
- –
- Each change plays the effect again; 0 shows its resting state.