Screenshot
launchui/screenshotFreeComponent
A theme-aware screenshot component that switches between light and dark images.
Live preview
live · rendered by the registry
Rendered by launchui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.launchuicomponents.com/r/screenshot.jsonSource
1import Image, { type ImageProps } from "next/image";23import { cn } from "@/lib/utils";45interface ScreenshotProps {6 srcLight: string;7 srcDark?: string;8 alt: string;9 width: number;10 height: number;11 loading?: ImageProps["loading"];12 className?: string;13}1415export default function Screenshot({16 srcLight,17 srcDark,18 alt,19 width,20 height,21 loading,22 className,23}: ScreenshotProps) {24 if (!srcDark) {25 return (26 <Image27 src={srcLight}28 alt={alt}29 width={width}30 height={height}31 loading={loading}32 className={className}33 unoptimized={srcLight.endsWith(".svg")}34 />35 );36 }3738 return (39 <>40 <Image41 src={srcLight}42 alt={alt}43 width={width}44 height={height}45 loading={loading}46 className={cn(className, "block dark:hidden")}47 unoptimized={srcLight.endsWith(".svg")}48 />49 <Image50 src={srcDark}51 alt={alt}52 width={width}53 height={height}54 loading={loading}55 className={cn(className, "hidden dark:block")}56 unoptimized={srcDark.endsWith(".svg")}57 />58 </>59 );60}
What it pulls in
npm packages
Files it writes
More from launchui
All 24 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Badgebadge | launchui | Components | Free | 2 deps | |
| Buttonbutton | launchui | Components | Free | 2 deps | |
| Cardcard | launchui | Components | Free | 1 dep | |
| Glowglow | launchui | Components | Free | 1 dep | |
| Launch UI Baselaunchui | launchui | Components | Free | no deps · 10 files | |
| Mockupmockup | launchui | Components | Free | 1 dep | |
| Pro Dependenciespro | launchui | Components | Free | 14 deps |
