Slider

This is a Slider component.

Loremipsum

Brandlogo

Logoipsum

Loremipsum

Brandlogo

Logoipsum

Loremipsum

Brandlogo

Logoipsum

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 Slider Code

Loading...

Copy Slider Code

Slider Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe content of the slider.
widthstringNo"200px"The width of the slider.
durationnumberNo4000Duration of each slide in milliseconds.
toRightbooleanNofalseDirection of the slide transition.
pauseOnHoverbooleanNofalsePause the slider on hover.

Slide Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe content of the slide.
widthstringNo"200px"The width of the slide.
classNamestringNoundefinedAdditional class names for styling.