Rendyn

Component library

189 components

Interaction

Pixel Image

Pixel Image reveals an image through independently fading clipped tiles. This is a tiled entrance effect, rather than an image editor or a pixel-art conversion algorithm.

Interactive exampleReact Tailwind CSS

Practical React example

Use a decorative project image beside a real caption. Hide the repeated tile images from assistive technology and show a plain image when reduced motion is requested.

Before you copy and paste

Copy PixelImage and provide the cn helper it imports. Use React, Tailwind CSS and the image you have permission to display. This source has fixed square sizing; it does not accept alt, className or width props.

Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.

Describe the image once and provide a static alternative

'use client';

import { PixelImage } from '@/components/magicui/pixel-image';
import { useSyncExternalStore } from 'react';

const subscribe = () => () => {};
const clientSnapshot = () => true;
const serverSnapshot = () => false;

export function PixelArtwork({ src, description }: { src: string; description: string }) {
  // Keep random tile delays out of the server/client hydration comparison.
  const mounted = useSyncExternalStore(subscribe, clientSnapshot, serverSnapshot);
  return (
    <figure className="m-0">
      {/* The imported effect repeats img elements. Describe the whole image once. */}
      <div className="size-72 md:size-96" aria-hidden="true">
        {mounted && <div className="motion-reduce:hidden">
          <PixelImage src={src} grid="6x4" maxAnimationDelay={500} />
        </div>}
        <img
          src={src}
          alt=""
          width={384}
          height={384}
          className={`${mounted ? 'hidden motion-reduce:block' : 'block'} size-72 rounded-[2.5rem] object-cover md:size-96`}
        />
      </div>
      <figcaption className="mt-3 max-w-sm text-sm">{description}</figcaption>
    </figure>
  );
}

The figure caption describes the image in both views. The server renders a plain image; useSyncExternalStore switches to the decorative effect after hydration. aria-hidden removes repeated tile descriptions, while Tailwind’s motion-reduce variant retains the plain image for reduced motion. Keep linked images and essential actions outside the hidden effect.

Customization

grid / customGrid
Use 6x4, 8x8, 8x3, 4x6 or 3x8. customGrid accepts integer rows and cols from 1 to 16. Invalid custom grids fall back to grid; pass a known preset because this version does not guard an unknown grid string.
pixelFadeInDuration / maxAnimationDelay
Both use milliseconds. Duration is per tile; the random delay is at most maxAnimationDelay. A denser grid creates more DOM and img elements, so measure it on the devices you support.
grayscaleAnimation / colorRevealDelay
Color reveal is a separate timer. The pinned source defaults to a 1,300ms delay, even if newer upstream documentation differs. Set grayscaleAnimation={false} to skip the color transition.

Integration notes

  • The source emits one img per tile, each with a generic piece alt. The wrapper addresses the repeated accessible descriptions without changing imported source or its licence.
  • Tile delays use Math.random during render. This can cause server/client style differences when the imported effect is rendered directly on the server. The wrapper mounts that effect after hydration and reserves its square area; it does not suppress hydration warnings or change the pinned source.
  • The effect starts on mount, not on scroll or after successful image loading. It has no error fallback and no built-in reduced-motion handling. The CSS fallback shown still mounts the hidden effect; adapt the source if you also need to avoid its work.

Component source: Magic UI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.

Better with your agent

Give your agent taste.

The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.

All components are free. Sign up only to connect MCP.

Connect to MCP