Measured entry

cultui-bg-media

background-effectliquid-glassmotion on file

A client-side React background media wrapper that renders either an eager image or an autoplaying muted MP4 video, with light, dark, or no overlay and a video play control. It ships as a shadcn registry TSX file and relies on React, CVA, Tailwind utility classes, and the usual cn helper alias.

Specimen
Motion capture of the mounted demo, recorded by the harness. No audio track.
Harness screenshot of cultui-bg-media at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of cultui-bg-media at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of cultui-bg-media at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

Measured

Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.

Harness measurements recorded for cultui-bg-media
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious0
Axe moderate0
Axe minor0
Gzip marginal27.0 KB (92.4 KB build, 65.4 KB baseline)
Bare modeFAIL
Provider requiredNO
Demo usedwritten from the component source API

What the harness recorded

BARE BUILD

✗ Build failed in 3.47s
error during build:
[vite:load-fallback] Could not load <sandbox>/src/lib/utils (imported by src/cut/components/ui/bg-media.tsx): ENOENT: no such file or directory, open '<sandbox>/src/lib/utils'

Verdict

A focused hero-media primitive that mounts cleanly in its configured environment and includes a useful playback control. It needs a shadcn-style setup before it works in a bare project, and its sizing and media-loading choices are opinionated enough to warrant source edits for broader reuse.

Use it if

  • You need a full-height hero background that can switch between an image and a muted video.
  • Your design calls for a simple light or dark overlay and an exposed video play control.
  • Your app already uses shadcn conventions, Tailwind utilities, and a cn class-merging helper.

Skip it if

  • You need flexible container sizing rather than the component's opinionated viewport-height hero layout.
  • You need responsive image sources, lazy loading, or framework image optimization.
  • You need video formats beyond MP4 or robust playback state handling when autoplay is blocked or playback ends.
  • You want a decorative image without the component's fixed rounded lower corner.

Install

Installation record for cultui-bg-media
Declared dependenciesnone declared
Missing on installnone
Bare installfails once the shadcn-style helpers are removed, so it needs that setup
Providerno provider required in the harness

In a non-shadcn project, add React and class-variance-authority, configure Tailwind for the component source, provide an equivalent cn class-merging utility, and replace or configure the @ alias used to import that helper. Ensure the client-component directive is supported by your framework.

Source and credit

This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.

Alternatives

Other published entries for the background-effect pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.