Skip to content

Photographer Portfolio with Photo Grid

Dark Bootstrap 5 photographer portfolio with subject filters, a full-bleed dense photo grid with wide and tall tiles, hover captions and a modal lightbox.

Also known as: photography portfolio, photo gallery grid with lightbox, masonry photo wall, photographer website gallery

Bootstrap 5 Portfolios Responsive Dark #dark #gallery #grid #lightbox #photo #portfolio

Photographer Portfolio with Photo Grid live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A dark Bootstrap 5 portfolio page for photographers: a minimal header with subject filters and a full-bleed photo grid that mixes wide, tall and square tiles, with hover captions and a modal lightbox. Use it for landscape, wedding or architecture portfolios and agency showcases.

How it works

The root is section.pf-portfolio. The header.pf-head holds the photographer name, the h2.pf-title and a group of .pf-filter buttons. Below it, ul.pf-grid is a CSS grid with grid-auto-flow: dense that runs edge to edge with a hairline gap: one column on phones, two from 576px and four from 992px. Each li.pf-cell contains an a.pf-item link to the large version of the photo. .pf-cell--wide spans two columns and .pf-cell--tall spans two rows, and the dense flow fills the holes so the wall stays tight. On hover or focus the image zooms slightly and the .pf-meta gradient caption slides in; on touch devices captions are always visible.

The script runs on DOMContentLoaded for every .pf-portfolio. A filter button reads its data-pf-filter value, hides each cell whose data-pf-category list does not contain it, updates aria-pressed and writes "Showing 4 photos" into .pf-count. Clicking a photo opens the Bootstrap modal .pf-modal with the full-size image and the data-pf-caption text. The .pf-modal__prev and .pf-modal__next buttons and the Left and Right arrow keys step through the visible photos only, so the lightbox respects the active filter. Without JavaScript the links simply open the large photo.

The photos come from Unsplash; replace them with your own work.

Customization

  • --pf-accent in .pf-portfolio, .pf-modal: changes the gold kicker text and the focus outlines.
  • --pf-bg and --pf-text: switch the page to another dark tone or to a light gallery.
  • --pf-row: sets the height of one grid row; tall tiles are two rows high.
  • --pf-gap: widen the hairline gap between photos, for example to 12px for a framed look.
  • Add pf-cell--wide or pf-cell--tall to any li.pf-cell to change the rhythm of the grid.
  • data-pf-category on each cell and a matching data-pf-filter button: add your own subjects such as weddings or portraits.
  • grid-template-columns: repeat(4, 1fr) in the 992px media query: use repeat(3, 1fr) for larger tiles.

Use cases

  • Landscape photographers: a dense edge-to-edge grid with wide and tall tiles shows work with hover captions
  • Wedding photographers: subject filters let couples browse only the category they care about
  • Architecture portfolios: clicking a photo opens a lightbox with arrows that step through the visible images
  • Agency showcases: a dark gallery page presents client work with a live showing count

Accessibility

Filters sit in a labelled role="group" and expose their state through aria-pressed; .pf-count is a role="status" region. Every photo has a descriptive alt, and the lightbox reuses it. The modal is labelled by its caption, focus moves into it and returns to the clicked photo on close. All controls show a gold :focus-visible outline, and zoom and fade transitions stop under prefers-reduced-motion: reduce.

Usage notes

Requires Bootstrap 5 with its JS bundle and Bootstrap Icons. The script moves each modal to body, so several portfolios can share a page.

Photographer Portfolio with Photo Grid at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Portfolios
License
Free for personal and commercial use

Questions about this template

Can I use the Photographer Portfolio with Photo Grid code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Photographer Portfolio with Photo Grid – Bootstrap 5 portfolios component screenshot
Photographer Portfolio with Photo Grid · Bootstrap 5 Portfolios

More Portfolios

Developer Portfolio Page – Tailwind CSS portfolios preview

Developer Portfolio Page

One-page Tailwind CSS developer portfolio with sticky mobile menu, hero stats, filterable project grid, experience timeline and a validated contact form.

Agency Case Study Grid with Images – Tailwind CSS portfolios preview

Agency Case Study Grid with Images

Dark Tailwind CSS portfolio grid of agency case studies with project photos, client, year, key results and service filter buttons.