Skip to content

    Browse components

    Focus Pull

    Fades and un-blurs its children as they scroll into view, like a lens pulling focus.

    Open
    Customize
    ease-out
    ease-in-out
    ease
    linear

    Installation

    npx shadcn@latest add @glint-ui/focus-pull

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/focus-pull.json

    Usage

    import { FocusPull } from "@/components/ui/focus-pull";
    
    <FocusPull blur={12} duration={1000}>
      <img src="/photo.jpg" alt="" />
    </FocusPull>

    Props

    PropTypeDefaultDescription
    childrenReactNode—Content to reveal.
    blurnumber12Starting blur in px.
    durationnumber1000Duration in ms.
    delaynumber0Ms to wait once in view.
    easing"ease-out" | "ease-in-out" | "ease" | "linear""ease-out"Any CSS timing function.
    initialOpacitynumber0Starting opacity.
    thresholdnumber0.2Fraction of the element visible before it fades in.
    oncebooleantrueFade only the first time it enters view.
    scrollContainerRefReactNode—Ref to a scrolling ancestor. Defaults to the viewport.
    classNamestring—Extra classes for the root element.