Skip to main content

Installation

    Examples

    Static Lens

    Lens with a Default Position

    Usage

    showLineNumbers
    import { Lens } from "@/components/ui/lens"
    
    showLineNumbers
    <Lens>
      <img src="/images/lens-demo.jpg" alt="Lens Demo" />
    </Lens>
    

    Props

    PropertyTypeDefaultDescription
    childrenReact.ReactNode-The content that will be magnified by the lens
    zoomFactornumber1.3The magnification factor of the lens
    lensSizenumber170The size of the lens in pixels (works as a diameter)
    positionPosition-The current position of the lens
    defaultPositionPosition-The initial position of the lens
    isStaticbooleanfalseDetermines if the lens will remain in a fixed position
    durationnumber0.1Duration of the animation when the lens moves (in seconds)
    lensColorstring-The color of the lens (CSS color value)
    ariaLabelstring-Accessibility label for the lens component

    Build docs developers (and LLMs) love