Font Awesome Build Awesome
Search ⌘KCtrl+K
Light Dark System Docs Color Scheme: System \ Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Theme: Default Icon Style: Classic Regular
Solid Regular Light Thin Classic Sharp Duotone Sharp Duotone
Docs Most styles require Font Awesome Pro.
Server-Side Rendering: Off Server-Side Rendering Docs
View on GitHub
Start Components Docs Help Pro
Login Log into your account
Web Awesome Font Awesome Build Awesome
Search this site… /
Light Dark System Docs Color Scheme: System \ Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Theme: Default Icon Style: Classic Regular
Solid Regular Light Thin Classic Sharp Duotone Sharp Duotone
Docs Most styles require Font Awesome Pro.
Server-Side Rendering: Off Server-Side Rendering Docs
View on GitHub
Components Pro

Getting Started

  • Installation
  • Usage
  • Forms
  • Localization
  • Frameworks
  • Using with AI
  • Figma Design Kit ProThis requires access to Web Awesome Pro
  • Server Rendering

Resources

  • Accessibility
  • Browser Support
  • Contributing
  • Patterns ProPatterns require access to Web Awesome Pro
  • Migrating from Shoelace
  • Visual Tests
  • Changelog
  • Help & Support

Theming & Utilities

  • Overview
  • Built-in Themes
  • Color Palettes
  • Design Tokens
  • Customizing & Theming
  • CSS Utilities

Actions

  • Button
  • Button Group
  • Copy Button
  • Dropdown
    • Dropdown Item

Forms

  • Checkbox
  • Checkbox Group
  • Color Picker
  • Combobox ProThis requires access to Web Awesome Pro
  • Date Input ProThis requires access to Web Awesome Pro
  • Date Picker ProThis requires access to Web Awesome Pro
  • File Input ProThis requires access to Web Awesome Pro
  • Input
  • Known Date
  • Number Input
  • OTP Input
  • Radio Group
    • Radio
  • Rating
  • Rich Text Editor ProThis requires access to Web Awesome Pro
  • Select
    • Option
  • Slider
  • Switch
  • Tag Input
  • Textarea
  • Time Input

Layout

  • Accordion
    • Accordion Item
  • Card
  • Details
  • Dialog
  • Divider
  • Drawer
  • Page
  • Scroller
  • Split Panel

Navigation

  • Breadcrumb
    • Breadcrumb Item
  • Pagination
  • Stepper
    • Step
  • Tab Group
    • Tab
    • Tab Panel
  • Tree
    • Tree Item

Feedback

  • Badge
  • Callout
  • Progress Bar
  • Progress Ring
  • Skeleton
  • Spinner
  • Tag
  • Toast
    • Toast Item
  • Tooltip

Media

  • Animated Image
  • Avatar
  • Carousel
    • Carousel Item
  • Code Highlighter
  • Comparison
  • Icon
  • Lightbox
    • Lightbox Item
  • Markdown
  • QR Code
  • Video ProThis requires access to Web Awesome Pro
  • Video Playlist ProThis requires access to Web Awesome Pro
  • Zoomable Frame

Data Viz ProThis requires access to Web Awesome Pro

  • Bar Chart
  • Bubble Chart
  • Data Grid
  • Doughnut Chart
  • Line Chart
  • Pie Chart
  • Polar Area Chart
  • Radar Chart
  • Scatter Chart
  • Sparkline
  • Advanced Usage

Helpers

  • Animation
  • Counter
  • Format Bytes
  • Format Date
  • Format Number
  • Include
  • Intersection Observer
  • Mutation Observer
  • Number Ticker
  • Popover
  • Popup
  • Random Content
  • Relative Time
  • Resize Observer

Lightbox Item

  • API
  • Importing
  • Slots
  • Attributes & Properties
  • Methods
  • Custom States
  • CSS Parts
  • Dependencies
On This Page...
  • API
  • Importing
  • Slots
  • Attributes & Properties
  • Methods
  • Custom States
  • CSS Parts
  • Dependencies

Lightbox Item

<wa-lightbox-item>
Experimental Media Since 3.15

Lightbox items represent the individual images and videos shown in a lightbox. Each one wraps the thumbnail that opens it.

This component must be used as a child of <wa-lightbox>. Please see the Lightbox docs to see examples of this component in action.

API

Link to This Section

Importing

Link to This Section

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.

CDN npm Self-Hosted React

Import this component directly from the CDN:

import 'https://ka-f.webawesome.com/[email protected]/components/lightbox-item/lightbox-item.js';

After installing Web Awesome via npm, import this component:

import '@awesome.me/webawesome/dist/components/lightbox-item/lightbox-item.js';

If you're self-hosting Web Awesome, import this component from your server:

import './webawesome/dist/components/lightbox-item/lightbox-item.js';

To import this component for React 18 or below, use the following code:

import WaLightboxItem from '@awesome.me/webawesome/dist/react/lightbox-item/index.js';

Slots

Link to This Section

Learn more about using slots.

Name Description
(default) The item's thumbnail, usually an <img>. Clicking it opens the lightbox at this item. Leave it empty to add an item that only appears in the lightbox. To show your own content in the lightbox, such as a video player or an embed, add it in a <template>.
play-icon Optional play icon to use instead of the default. Works best with <wa-icon>.

Attributes & Properties

Link to This Section

Learn more about attributes and properties.

Name Description Reflects
alt
alt
Alternative text for the full-size media. Defaults to the slotted thumbnail's alt.
Type string
Default ''
caption
caption
A plain text caption to show with the item in the lightbox.
Type string
Default ''
height
height
The intrinsic height of the full-size media in pixels.
Type number
sizes
sizes
The sizes to use with srcset. When omitted, the lightbox uses the viewport width, and the zoomed width once the image is zoomed in.
Type string
Default ''
src
src
The URL of the full-size image or video. The thumbnail links to it, so the item still works without JavaScript and when opened in a new tab.
Type string
Default ''
srcset
srcset
A set of image sources for the full-size image, in the same format as the <img> srcset attribute.
Type string
Default ''
thumbnail
thumbnail
The URL of a thumbnail to use in the lightbox's thumbnail strip and as a placeholder while the full-size media loads. Only needed when no <img> is slotted in.
Type string
Default ''
type
type
The kind of media the item shows in the lightbox. Videos show a play button over their thumbnail.
Type 'image' | 'video'
Default 'image'
width
width
The intrinsic width of the full-size media in pixels. Set this with height so the lightbox can size the slide before the media loads.
Type number

Methods

Link to This Section

Learn more about methods.

Name Description Arguments
focus() Sets focus on the item's trigger. options: FocusOptions

Custom States

Link to This Section

Learn more about custom states.

Name Description CSS selector
active Applied when this is the current item in an open lightbox. :state(active)
empty Applied when nothing is slotted in. Empty items aren't displayed on the page. :state(empty)
morphing Applied while the lightbox animates between this item's thumbnail and its full-size media. :state(morphing)

CSS Parts

Link to This Section

Learn more about CSS parts.

Name Description CSS selector
play-button The play button shown over a video's thumbnail. ::part(play-button)
trigger The link that wraps the thumbnail and opens the lightbox. ::part(trigger)

Dependencies

Link to This Section

This component automatically imports the following elements. Sub-dependencies, if any exist, will also be included in this list.

  • <wa-icon>
Need a hand? Report a bug Ask for help
Go Make Something Awesome
Version 3.15.0 © Fonticons, Inc.
  • Terms
  • Privacy
  • Refunds
  • Core License
  • Pro License

Quick Links

  • Components
  • CSS Utilities
  • Theming
  • Using with AI
  • Changelog
  • Help & Support

Recent Searches

    D'oh! No results for “”

    Suggest on GitHub Ask on Discord
    Navigate Select
    Close Esc

    We Have Cookies…

    We use cookies to make webawesome.com work better by storing limited information about your usage.

    We value your privacy, so we won't use them for evil or ask you to join the dark side.

    Customize
    Necessary Only Accept All
    Strictly Necessary
    Required to make the site function correctly — cannot be turned off
    Functionality Analytics
    Cancel Confirm Cookie Choices