BadtzUIBeta
Docs
Image Split

Image Split

This component provides a dynamic and visually captivating way to display images split into multiple sections.

Scroll to reveal

Installation

pnpm dlx shadcn@latest add to-setup

Usage

import { ImageSplit } from "@/components/ui/image-split";
<ImageSplit
  src="/images/components/image-split/badtz-ui-documentation-dark.webp"
  sections={9}
/>

Props

ImageSplit props.

PropTypeDescriptionDefault
srcstringThe URL of the image to be split.-
sectionsnumberThe number of sections the image is divided into.9
offsetStepnumberThe step value for vertical offset applied to each image section.30
initialBorderOpacitynumberThe initial opacity of the borders between image sections.0.4
enableBorderbooleanWhether to display borders between image sections.true
borderColorstringThe color of the borders between sections in hex format."#ffffff"
viewportThresholdnumberThe percentage of the viewport height at which the animation starts.0.3
classNamestringAdditional CSS classes for styling the container.-
[key: string]anyAny additional props passed to the parent <div>.-

Credits

  • This component is inspired by Reflect

  • Expandable CardImage Trail