Reusables

Theme Image

An Image component for seamless theme switching.

Installation

npx shadcn@latest add "https://reusables.vercel.app/r/theme-image"

Usage

import { ThemeImage } from "@/components/ui/theme-image"
<ThemeImage
  darkSrc={"/image-dark.png"}
  lightSrc={"/image-light.png"}
  alt="image"
/>

Example

Click the theme icons on the sidebar to demo.

Reference

PropTypeDefault
lightSrc
string
-
darkSrc
string
-
Edit on GitHub

Last updated on

On this page