Astryx

Astryx Lightbox

Galleries

About

A fullscreen overlay for viewing images and videos at full resolution. Supports single-item and gallery modes with prev/next navigation and swiping, optional zoom and pan for images, and native video controls. Astryx by Meta. Source: https://astryx.atmeta.com/components/Lightbox

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Lightbox to your project and fits it to your theme.

Code

How Astryx Lightbox is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

/* Copyright (c) 2026 Meta Platforms, Inc. See MIT notice in astryx-lightbox.tsx. */

import {useState} from 'react';
import {Lightbox} from '@/components/ui/astryx-lightbox';

function LightboxShowcase() {
  const [isOpen, setIsOpen] = useState(false);
  return (
    <>
      <button onClick={() => setIsOpen(true)}>View image</button>
      <Lightbox
        isOpen={isOpen}
        onOpenChange={setIsOpen}
        media={{
          src: 'https://cdn.21st.dev/assets/mirror/38/387ca9dada3bc020ee335bfae84c266dbb6b2340279c5c3db15d484d7b72c83f.png',
          alt: 'Coastal shoreline with ocean waves',
          caption:
            'A scenic coastline with waves rolling onto a sandy beach beneath a clear sky.',
        }}
      />
    </>
  );
}

export default function Demo() {
  return (
    <div data-astryx-theme="neutral" data-theme="light" style={{display: 'grid', minHeight: '100vh', placeItems: 'center', padding: 24}}>
      <div style={{width: '100%', maxWidth: 400}}>
        <LightboxShowcase />
      </div>
    </div>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    61
  • Astryx Avatar

    Astryx Avatar

    34
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    32
  • Astryx Badge

    Astryx Badge

    30
  • Astryx Button Group

    Astryx Button Group

    29
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    27
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    10

More in Galleries

View all
  • Gallery Component

    Gallery Component

    39
  • Scattered About

    Scattered About

    67
  • Photo Deck

    Photo Deck

    66
  • Spiral Ribbon Gallery

    Spiral Ribbon Gallery

    32
  • Cloth Works Gallery

    Cloth Works Gallery

    57
  • Image Gallery

    Image Gallery

    131
  • Phantom Infinite Gallery

    Phantom Infinite Gallery

    103
  • Elastic Gallery

    Elastic Gallery

    1.2K