Media Boxes documentation
Everything you need to install Media Boxes, build a grid, tune it and script it. Every example runs as written.
Media Boxes 4.0.0 is one custom element, <media-boxes>, with no dependencies. Start with the install page, then read the guides in any order. The reference pages list every option, attribute, method and event.
Start
Guides
- LayoutsChoose masonry, grid, justified or mosaic. Set columns, gap, breakpoints that follow the grid width, row height and mosaic spans, with copy-paste examples.
- Skins and captionsPick a skin (card, plain, caption, overlay, hover or image), choose hover effects and fill items with titles, categories, prices, authors, badges and durations.
- Filtering and searchAdd filter pills, tabs or selects, several filter groups with AND or OR logic, search, sorting and shareable deep links. Includes outside controls and the API.
- LoadingShow a big gallery in parts with a Load more button, infinite scroll or numbered pagination. Set how many items appear first and how many each step adds.
- LightboxOpen photos, video, YouTube, Vimeo, iframes and HTML in a fast lightbox with zoom, swipe, thumbnails and slideshow. Every option, custom buttons, keys, events.
- ThemingRestyle Media Boxes with CSS custom properties. Switch between light, dark and auto themes, match your brand colours and restyle the lightbox with no code.
- Accessibility and i18nHow Media Boxes works with keyboards, screen readers and reduced motion, and how to translate every label, set number formats and run right-to-left grids.
Reference
- Options referenceEvery Media Boxes option in one place, with type, default and meaning, grouped by layout, appearance, loading, filters, deep links, lightbox, items and text.
- HTML attributesEvery attribute Media Boxes reads on the grid, on items and media links and on outside controls, plus the hooks it sets for CSS and which options need JSON.
- API and eventsControl a grid from JavaScript. Methods to filter, search, sort, load, add and remove items and open the lightbox, plus every event with its detail payload.
Help
- FAQ and troubleshootingAnswers to common questions and fixes for usual problems: an empty grid, jumping images, missing filters, a lightbox that will not open, deep links, frameworks.
- Migrating from Media Boxes version 3Move a Media Boxes version 3 jQuery grid to version 4.0. See what changed, how options, markup, callbacks and CSS map across, a before and after example and an FAQ.
- ChangelogVersion history of Media Boxes. Version 4.0.0 is a full rewrite as a zero-dependency custom element with a built-in lightbox. Includes the history of version 3.x (jQuery).