Video Card

A customizable video card component with support for hover effects, aspect ratios, and playback controls.

Installation

1. Dependencies

npm install clsx tailwind-merge

2. Paste inside @/lib/utils.ts

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Parameters<typeof clsx>) {
  return twMerge(clsx(...inputs));
}

3. Copy Video Card Code

Loading...

Copy Video Card Code

VideoCard Props

NameTypeRequiredDefaultDescription
srcstringYesundefinedThe source URL of the video.
posterstringNoundefinedThe URL of the poster image to display before the video plays.
aspectRatio"square" | "video" | "vertical" | "wide"No"video"The aspect ratio of the video card.
autoPlaybooleanNofalseDetermines if the video should play automatically when loaded.
mutedbooleanNotrueDetermines if the video should be muted.
loopbooleanNotrueDetermines if the video should loop when it ends.
controlsbooleanNofalseDetermines if playback controls should be displayed.
playOnHoverbooleanNotrueDetermines if the video should play when hovered.
scaleOnHoverbooleanNotrueDetermines if the video card should scale slightly when hovered.
classNamestringNoundefinedAdditional class names for custom styling.