Laptop Mockup
nexvyn/laptop-mockupFreeComponent
A laptop device-frame illustration for showcasing app screens.
Live preview
live · rendered by the registry
Rendered by nexvyn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.nexvyn.dev/r/laptop-mockup.jsonSource
1'use client'23import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react'4import { cn } from '@/lib/utils'56const laptopChassisVariants = {7 gray: {8 border: 'border-(--color-border)',9 base: 'bg-(--color-muted)',10 notch: 'bg-(--color-border)',11 },12 titanium: {13 border: 'border-(--color-foreground)',14 base: 'bg-(--color-card)',15 notch: 'bg-(--color-muted)',16 },17} as const1819type LaptopChassisVariant = keyof typeof laptopChassisVariants2021type LaptopMockupCardProps = Readonly<22 ComponentPropsWithoutRef<'div'> & {23 variant?: LaptopChassisVariant24 children?: ReactNode25 }26>2728export const LaptopMockupCard = forwardRef<HTMLDivElement, LaptopMockupCardProps>(29 ({ className, children, variant = 'gray', ...props }, ref) => {30 const frame = laptopChassisVariants[variant]3132 return (33 <div34 ref={ref}35 data-slot="laptop-mockup-card"36 data-variant={variant}37 className={cn('flex flex-col items-center font-sans', className)}38 {...props}39 >40 <div41 className={cn(42 'w-[280px] overflow-hidden rounded-t-xl border-2 border-b-0 shadow-xl md:w-[384px]',43 frame.border,44 )}45 >46 <div className="bg-black p-1.5 pb-0">47 <div className="relative h-[184px] overflow-hidden rounded-t-[4px] bg-black md:h-[252px]">48 <div className="relative size-full overflow-hidden rounded-t-[4px]">{children}</div>49 </div>50 </div>51 </div>5253 <div54 className={cn('relative h-2.5 w-[315px] rounded-b-xl md:h-3 md:w-[432px]', frame.base)}55 >56 <div57 className={cn(58 'absolute top-0 left-1/2 h-1 w-14 -translate-x-1/2 rounded-b-md md:w-16',59 frame.notch,60 )}61 aria-hidden="true"62 />63 </div>64 </div>65 )66 },67)6869LaptopMockupCard.displayName = 'LaptopMockupCard'
Files it writes
More from nexvyn
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Badgebadge | nexvyn | Components | Free | 2 deps · 2 files | |
| Bars Themebars-theme | nexvyn | Components | Free | 1 dep · 3 files | |
| Bounce Sidebarbounce-sidebar | nexvyn | Components | Free | 1 dep · 2 files | |
| Breadcrumbsbreadcrumbs | nexvyn | Components | Free | 1 dep · 2 files | |
| Checkboxcheckbox | nexvyn | Components | Free | 1 dep · 3 files | |
| Clipboard Fieldclipboard-field | nexvyn | Components | Free | no deps · 2 files | |
| Color Pickercolor-picker | nexvyn | Components | Free | no deps · 16 files | |
| Comboboxcombobox | nexvyn | Components | Free | 1 dep · 2 files |
