Lightbox

A full-screen preview surface for image, screenshot, and attachment review.

Preview#

import {
  Lightbox,
  LightboxClose,
  LightboxContent,
  LightboxInfoActions,
  LightboxInfoBar,
  LightboxInfoDock,
  LightboxInfoTitle,
  LightboxMedia,
  LightboxNavigationButton,
  LightboxStage,
  LightboxThumbnail,
  LightboxThumbnailStrip,
  LightboxTitle,
  LightboxTrigger,
} from "raft-ui";

<Lightbox>
  <LightboxTrigger />
  <LightboxContent>
    <LightboxTitle />
    <LightboxClose />
    <LightboxStage>
      <LightboxNavigationButton direction="previous" />
      <LightboxNavigationButton direction="next" />
      <LightboxMedia />
      <LightboxInfoDock>
        <LightboxInfoBar>
          <LightboxInfoTitle />
          <LightboxInfoActions />
        </LightboxInfoBar>
      </LightboxInfoDock>
      <LightboxThumbnailStrip>
        <LightboxThumbnail />
      </LightboxThumbnailStrip>
    </LightboxStage>
  </LightboxContent>
</Lightbox>

Image shell#

API#WIP

...props
Base UI Dialog.Root props
Owns open state, modal behavior, Escape, pointer dismissal, and the optional Mod+W close helper.
...props
Base UI Dialog.Trigger props
Opens the lightbox. Compose Button through render for visible triggers.
container
HTMLElement | RefObject | null
Custom portal container for framed previews or contained overlays.
...props
Dialog.Portal.Props
Portals the lightbox to the body or a custom container.
...props
Base UI Dialog.Popup props
Renders Portal, Backdrop, and Popup. Defaults initialFocus/finalFocus to false for preview-like surfaces.
...props
div props
Attachment header: left LightboxHeaderMeta + right LightboxActions. Owns in-flow button layout so Close is not treated as the image-shell floating control.
...props
div props
In-flow header row for simpler shells (title + actions in document flow).
...props
Base UI Dialog.Close props
Close control. Direct child of LightboxContent → floating top-right (image shell). Inside LightboxToolbar → in-flow with the action buttons.
...props
div props
Toolbar left cluster (gap 6px): preview-type chip then truncating filename.
...props
span props
Preview-type chip (or Badge) inside LightboxHeaderMeta.
...props
div props
Media frame for the stage photo. Borderless with a transparent background.
...props
div props
Absolute dock that centers LightboxInfoBar near the bottom of the stage.
...props
div props
Toolbar right cluster (chip + buttons).
...props
div props
Flex-1 preview surface under Toolbar or Header.
direction
"next" | "previous"
Chooses the previous or next affordance for multi-item preview navigation.
disabled
boolean
Disables the control and blocks click handling.
...props
ButtonProps (size/variant/loading omitted)
Button attributes for the navigation control.
...props
div props
Bottom info bar centered by LightboxInfoDock.
...props
useRender.ComponentProps<"div">
Truncating title used inside LightboxInfoDock.
...props
useRender.ComponentProps<"div">
Action row inside LightboxInfoDock for caller-owned actions.
...props
div props
Absolute strip that centers LightboxThumbnail controls along the bottom of the stage.
active
boolean
Marks the current thumbnail and updates border/overlay chrome.
...props
button props
Thumbnail control. Put the preview image in children; selection state stays caller-owned.
...props
div props
Truncating title slot, usually filename or preview label.