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#

Attachment shell#

API#WIP

PropTypeDefaultDescription
...propsBase UI Dialog.Root propsOwns open state, modal behavior, Escape, pointer dismissal, and the optional Mod+W close helper.
PropTypeDefaultDescription
...propsBase UI Dialog.Trigger propsOpens the lightbox. Compose Button through render for visible triggers.
PropTypeDefaultDescription
containerHTMLElement | RefObject | nullCustom portal container for framed previews or contained overlays.
...propsDialog.Portal.PropsPortals the lightbox to the body or a custom container.
PropTypeDefaultDescription
...propsBase UI Dialog.Popup propsRenders Portal, Backdrop, and Popup. Defaults initialFocus/finalFocus to false for preview-like surfaces.
PropTypeDefaultDescription
...propsdiv propsAttachment header: left LightboxHeaderMeta + right LightboxActions. Owns in-flow button layout so Close is not treated as the image-shell floating control.
PropTypeDefaultDescription
...propsdiv propsIn-flow header row for simpler shells (title + actions in document flow).
PropTypeDefaultDescription
...propsBase UI Dialog.Close propsClose control. Direct child of LightboxContent → floating top-right (image shell). Inside LightboxToolbar → in-flow with the action buttons.
PropTypeDefaultDescription
...propsdiv propsToolbar left cluster (gap 6px): preview-type chip then truncating filename.
PropTypeDefaultDescription
...propsspan propsPreview-type chip (or Badge) inside LightboxHeaderMeta.
PropTypeDefaultDescription
...propsdiv propsMedia frame for the stage photo. Borderless with a transparent background.
PropTypeDefaultDescription
...propsdiv propsAbsolute dock that centers LightboxInfoBar near the bottom of the stage.
PropTypeDefaultDescription
...propsdiv propsToolbar right cluster (chip + buttons).
PropTypeDefaultDescription
...propsdiv propsFlex-1 preview surface under Toolbar or Header.
PropTypeDefaultDescription
direction"next" | "previous"Chooses the previous or next affordance for multi-item preview navigation.
disabledbooleanDisables the control and blocks click handling.
...propsButtonProps (size/variant/loading omitted)Button attributes for the navigation control.
PropTypeDefaultDescription
...propsdiv propsBottom info bar centered by LightboxInfoDock.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Truncating title used inside LightboxInfoDock.
PropTypeDefaultDescription
...propsuseRender.ComponentProps<"div">Action row inside LightboxInfoDock for caller-owned actions.
PropTypeDefaultDescription
...propsdiv propsAbsolute strip that centers LightboxThumbnail controls along the bottom of the stage.
PropTypeDefaultDescription
activebooleanMarks the current thumbnail and updates border/overlay chrome.
...propsbutton propsThumbnail control. Put the preview image in children; selection state stays caller-owned.
PropTypeDefaultDescription
...propsdiv propsTruncating title slot, usually filename or preview label.