Photo gallery
The full-screen photo gallery of the listing page, with the Photos and Street view tabs, the photo mosaic, the lightbox, the sidebar and the mobile action bar, from FullGallery and Lightbox.
Every photo of a listing opens the full-screen gallery: a view over the listing page with a Photos
tab, a Street view tab when the home can show one, and the price, the contact card and the tour card
beside the photos on wide screens. A photo in the gallery opens the lightbox, which shows one photo
at a time. ListingDetail mounts the gallery for you, so a listing page built from the
listing detail recipe has it already. This page
explains how it works and how to use it on a layout of your own.
What the visitor sees
<!--
The full gallery dialog, closed, on its Photos tab.
From the React component FullGallery with ContactCards and MobileActionBar. Generated by npm run idx:recipes-static from @ruuster/idx-recipes. Do not edit it by hand.
Fill each value from:
[data-rw-gallery-tab=street] and [data-rw-gallery-panel=street]: with your Google Maps key, listing.geo and a shown address
.rw-fullgallery__tile (one per photo): each of listing.photos with an http or https URL: rw-fullgallery__tile--full for positions 0, 3, 6 and so on and for a last photo left without a partner, else --half; alt is empty because the button is named "Open photo {n} of {count}"; sizes "(min-width: 1280px) 960px, (min-width: 992px) 60vw, 100vw" on a full tile, "(min-width: 1280px) 480px, (min-width: 992px) 30vw, (min-width: 768px) 50vw, 100vw" on a half one
.rw-fullgallery__share and .rw-fullgallery__float-share: when you share a URL
.rw-fullgallery__sidebar: price-block.html (with a p for the address), then your sidebar in .rw-fullgallery__sticky
.rw-fullgallery__bar: mobile-bar.html, when the page has it
dialog.rw-lightbox: fixed markup; the step buttons only with two or more photos
id, aria-controls, aria-labelledby: any values that are unique on the page
Every data-rw-* attribute is a hook for ruuster-idx.js; see ../HOOKS.md.
-->
<dialog class="rw-recipes rw-fullgallery" aria-label="Photo gallery" data-rw-screen="gallery">
<div class="rw-fullgallery__header" data-rw-gallery-header="">
<div class="rw-fullgallery__header-inner">
<div role="tablist" aria-label="Photos and street view" class="rw-fullgallery__tabs">
<button type="button" role="tab" id="full-gallery-1-tab-photos" aria-selected="true" aria-controls="full-gallery-1-panel-photos" tabindex="0" class="rw-fullgallery__tab" data-rw-gallery-tab="photos">Photos</button>
<button type="button" role="tab" id="full-gallery-1-tab-street" aria-selected="false" aria-controls="full-gallery-1-panel-street" tabindex="-1" class="rw-fullgallery__tab" data-rw-gallery-tab="street">Street view</button>
</div>
<div class="rw-fullgallery__actions">
<button type="button" class="rw-fullgallery__share" data-rw-open="share"><svg class="rw-icon" viewBox="0 0 20 20" width="20" height="20" data-rw-icon="share-white" focusable="false" aria-hidden="true"><g fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99935 13.1243C10.3445 13.1243 10.6243 12.8445 10.6243 12.4993V3.35555L12.0248 4.98943C12.2495 5.25151 12.644 5.28186 12.9061 5.05722C13.1682 4.83258 13.1985 4.43802 12.9739 4.17594L10.4739 1.25927C10.3551 1.12074 10.1818 1.04102 9.99935 1.04102C9.8169 1.04102 9.64355 1.12074 9.52481 1.25927L7.02481 4.17594C6.80017 4.43802 6.83053 4.83258 7.0926 5.05722C7.35468 5.28186 7.74925 5.25151 7.97388 4.98943L9.37435 3.35555L9.37435 12.4993C9.37435 12.8445 9.65417 13.1243 9.99935 13.1243Z" fill="currentColor"/><path d="M13.3327 7.49935C12.7475 7.49935 12.4549 7.49935 12.2448 7.63978C12.1538 7.70058 12.0756 7.77872 12.0148 7.86973C11.8744 8.07991 11.8744 8.37249 11.8744 8.95765L11.8744 12.4993C11.8744 13.5349 11.0349 14.3743 9.99938 14.3743C8.96385 14.3743 8.12438 13.5349 8.12438 12.4993L8.12438 8.95772C8.12438 8.37249 8.12438 8.07988 7.98393 7.86968C7.92313 7.77871 7.84502 7.7006 7.75405 7.63981C7.54385 7.49935 7.25124 7.49935 6.66602 7.49935C4.30899 7.49935 3.13048 7.49935 2.39825 8.23158C1.66602 8.96381 1.66602 10.1421 1.66602 12.4992V13.3325C1.66602 15.6895 1.66602 16.868 2.39825 17.6003C3.13048 18.3325 4.30899 18.3325 6.66602 18.3325H13.3327C15.6897 18.3325 16.8682 18.3325 17.6004 17.6003C18.3327 16.868 18.3327 15.6895 18.3327 13.3325V12.4992C18.3327 10.1421 18.3327 8.96381 17.6004 8.23158C16.8682 7.49935 15.6897 7.49935 13.3327 7.49935Z" fill="currentColor"/></g></svg>Share</button>
</div>
<button type="button" class="rw-fullgallery__close" aria-label="Close the gallery" data-rw-gallery-close=""><svg class="rw-icon" viewBox="0 0 24 24" width="20" height="20" data-rw-icon="close" focusable="false" aria-hidden="true"><g fill="none"><g clip-path="url(#rw-close-clip0_4_13476)"><path d="M18.3002 5.7107C17.9102 5.3207 17.2802 5.3207 16.8902 5.7107L12.0002 10.5907L7.11022 5.7007C6.72022 5.3107 6.09021 5.3107 5.70021 5.7007C5.31021 6.0907 5.31021 6.7207 5.70021 7.1107L10.5902 12.0007L5.70021 16.8907C5.31021 17.2807 5.31021 17.9107 5.70021 18.3007C6.09021 18.6907 6.72022 18.6907 7.11022 18.3007L12.0002 13.4107L16.8902 18.3007C17.2802 18.6907 17.9102 18.6907 18.3002 18.3007C18.6902 17.9107 18.6902 17.2807 18.3002 16.8907L13.4102 12.0007L18.3002 7.1107C18.6802 6.7307 18.6802 6.0907 18.3002 5.7107Z" fill="currentColor"/></g><defs><clipPath id="rw-close-clip0_4_13476"><rect width="24" height="24" fill="currentColor"/></clipPath></defs></g></svg></button>
</div>
</div>
<div class="rw-fullgallery__content">
<div class="rw-fullgallery__columns">
<div class="rw-fullgallery__main">
<div class="rw-fullgallery__mark" data-rw-gallery-mark="" aria-hidden="true"></div>
<div class="rw-fullgallery__tabcontent">
<div role="tabpanel" id="full-gallery-1-panel-photos" aria-labelledby="full-gallery-1-tab-photos" class="rw-fullgallery__panel" data-rw-gallery-panel="photos">
<div class="rw-fullgallery__mosaic" data-rw-mosaic="">
<button type="button" class="rw-fullgallery__tile rw-fullgallery__tile--full" aria-label="Open photo 1 of 6" data-rw-mosaic-tile="0"><img src="https://photos.ruuster.com/l/1/0.jpg" width="1200" height="800" alt="" loading="lazy" decoding="async" srcSet="https://photos.ruuster.com/l/1/0.jpg?width=480 480w, https://photos.ruuster.com/l/1/0.jpg?width=800 800w, https://photos.ruuster.com/l/1/0.jpg?width=1200 1200w" sizes="(min-width: 1280px) 960px, (min-width: 992px) 60vw, 100vw"/></button>
<button type="button" class="rw-fullgallery__tile rw-fullgallery__tile--half" aria-label="Open photo 2 of 6" data-rw-mosaic-tile="1"><img src="https://photos.ruuster.com/l/1/1.jpg" width="1200" height="800" alt="" loading="lazy" decoding="async" srcSet="https://photos.ruuster.com/l/1/1.jpg?width=480 480w, https://photos.ruuster.com/l/1/1.jpg?width=800 800w, https://photos.ruuster.com/l/1/1.jpg?width=1200 1200w" sizes="(min-width: 1280px) 480px, (min-width: 992px) 30vw, (min-width: 768px) 50vw, 100vw"/></button>
<button type="button" class="rw-fullgallery__tile rw-fullgallery__tile--half" aria-label="Open photo 3 of 6" data-rw-mosaic-tile="2"><img src="https://photos.ruuster.com/l/1/2.jpg" width="1200" height="800" alt="" loading="lazy" decoding="async" srcSet="https://photos.ruuster.com/l/1/2.jpg?width=480 480w, https://photos.ruuster.com/l/1/2.jpg?width=800 800w, https://photos.ruuster.com/l/1/2.jpg?width=1200 1200w" sizes="(min-width: 1280px) 480px, (min-width: 992px) 30vw, (min-width: 768px) 50vw, 100vw"/></button>
<button type="button" class="rw-fullgallery__tile rw-fullgallery__tile--full" aria-label="Open photo 4 of 6" data-rw-mosaic-tile="3"><img src="https://photos.ruuster.com/l/1/3.jpg" width="1200" height="800" alt="" loading="lazy" decoding="async" srcSet="https://photos.ruuster.com/l/1/3.jpg?width=480 480w, https://photos.ruuster.com/l/1/3.jpg?width=800 800w, https://photos.ruuster.com/l/1/3.jpg?width=1200 1200w" sizes="(min-width: 1280px) 960px, (min-width: 992px) 60vw, 100vw"/></button>
<button type="button" class="rw-fullgallery__tile rw-fullgallery__tile--half" aria-label="Open photo 5 of 6" data-rw-mosaic-tile="4"><img src="https://photos.ruuster.com/l/1/4.jpg" width="1200" height="800" alt="" loading="lazy" decoding="async" srcSet="https://photos.ruuster.com/l/1/4.jpg?width=480 480w, https://photos.ruuster.com/l/1/4.jpg?width=800 800w, https://photos.ruuster.com/l/1/4.jpg?width=1200 1200w" sizes="(min-width: 1280px) 480px, (min-width: 992px) 30vw, (min-width: 768px) 50vw, 100vw"/></button>
<button type="button" class="rw-fullgallery__tile rw-fullgallery__tile--half" aria-label="Open photo 6 of 6" data-rw-mosaic-tile="5"><img src="https://photos.ruuster.com/l/1/5.jpg" width="1200" height="800" alt="" loading="lazy" decoding="async" srcSet="https://photos.ruuster.com/l/1/5.jpg?width=480 480w, https://photos.ruuster.com/l/1/5.jpg?width=800 800w, https://photos.ruuster.com/l/1/5.jpg?width=1200 1200w" sizes="(min-width: 1280px) 480px, (min-width: 992px) 30vw, (min-width: 768px) 50vw, 100vw"/></button>
</div>
</div>
<div role="tabpanel" id="full-gallery-1-panel-street" aria-labelledby="full-gallery-1-tab-street" class="rw-fullgallery__panel rw-fullgallery__panel--street" data-rw-gallery-panel="street" hidden="">
<div class="rw-fullgallery__street">
<div class="rw-fullgallery__pano" data-rw-street-pano=""></div>
<div class="rw-fullgallery__street-wait" role="status">
<svg class="rw-icon rw-fullgallery__street-icon" viewBox="0 0 20 20" width="48" height="48" data-rw-icon="street-view-white" focusable="false" aria-hidden="true"><g fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.7085 3.33464C7.7085 2.06898 8.73451 1.04297 10.0002 1.04297C11.2658 1.04297 12.2918 2.06898 12.2918 3.33464C12.2918 4.60029 11.2658 5.6263 10.0002 5.6263C8.73451 5.6263 7.7085 4.60029 7.7085 3.33464Z" fill="currentColor"/><path d="M6.85241 9.64394L5.03967 9.0397C4.51822 8.86588 4.1665 8.3779 4.1665 7.82825C4.1665 7.01527 4.91611 6.40927 5.71105 6.57962L7.29235 6.91847C7.38029 6.93731 7.42425 6.94673 7.46784 6.95575C9.13816 7.30125 10.8615 7.30125 12.5318 6.95575C12.5754 6.94673 12.6194 6.93731 12.7073 6.91847L14.2886 6.57961C15.0836 6.40927 15.8332 7.01527 15.8332 7.82825C15.8332 8.3779 15.4815 8.86588 14.96 9.0397L13.1473 9.64394C12.9282 9.71697 12.8187 9.75348 12.7363 9.80432C12.4558 9.97748 12.3037 10.2997 12.3484 10.6263C12.3615 10.7222 12.4029 10.83 12.4858 11.0455L13.5248 13.7469C13.8341 14.551 13.2405 15.4153 12.379 15.4153C11.9384 15.4153 11.5316 15.1792 11.313 14.7967L9.99984 12.4986L8.68665 14.7967C8.46807 15.1792 8.06128 15.4153 7.62072 15.4153C6.75915 15.4153 6.16558 14.551 6.47486 13.7469L7.51385 11.0455C7.59675 10.83 7.6382 10.7222 7.65131 10.6263C7.69597 10.2997 7.5439 9.97748 7.26338 9.80432C7.18101 9.75348 7.07148 9.71697 6.85241 9.64394Z" fill="currentColor"/><path d="M9.99984 18.3316C14.6022 18.3316 18.3332 16.6526 18.3332 14.5816C18.3332 13.1467 16.5423 11.9 13.9115 11.2695L14.6915 13.2976C15.3157 14.9205 14.1177 16.6647 12.379 16.6647C11.4898 16.6647 10.6689 16.1883 10.2277 15.4163L9.99984 15.0175L9.77195 15.4163C9.33082 16.1883 8.50985 16.6647 7.62072 16.6647C5.88193 16.6647 4.68399 14.9205 5.30818 13.2976L6.08819 11.2695C3.45739 11.9 1.6665 13.1467 1.6665 14.5816C1.6665 16.6526 5.39746 18.3316 9.99984 18.3316Z" fill="currentColor"/></g></svg>
<span class="rw-visually-hidden">Street view is loading.</span>
</div>
</div>
</div>
<button type="button" class="rw-fullgallery__float-share" aria-label="Share this home" data-rw-open="share">
<svg class="rw-icon rw-icon--white" viewBox="0 0 20 20" width="16" height="16" data-rw-icon="share-white" focusable="false" aria-hidden="true"><g fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99935 13.1243C10.3445 13.1243 10.6243 12.8445 10.6243 12.4993V3.35555L12.0248 4.98943C12.2495 5.25151 12.644 5.28186 12.9061 5.05722C13.1682 4.83258 13.1985 4.43802 12.9739 4.17594L10.4739 1.25927C10.3551 1.12074 10.1818 1.04102 9.99935 1.04102C9.8169 1.04102 9.64355 1.12074 9.52481 1.25927L7.02481 4.17594C6.80017 4.43802 6.83053 4.83258 7.0926 5.05722C7.35468 5.28186 7.74925 5.25151 7.97388 4.98943L9.37435 3.35555L9.37435 12.4993C9.37435 12.8445 9.65417 13.1243 9.99935 13.1243Z" fill="currentColor"/><path d="M13.3327 7.49935C12.7475 7.49935 12.4549 7.49935 12.2448 7.63978C12.1538 7.70058 12.0756 7.77872 12.0148 7.86973C11.8744 8.07991 11.8744 8.37249 11.8744 8.95765L11.8744 12.4993C11.8744 13.5349 11.0349 14.3743 9.99938 14.3743C8.96385 14.3743 8.12438 13.5349 8.12438 12.4993L8.12438 8.95772C8.12438 8.37249 8.12438 8.07988 7.98393 7.86968C7.92313 7.77871 7.84502 7.7006 7.75405 7.63981C7.54385 7.49935 7.25124 7.49935 6.66602 7.49935C4.30899 7.49935 3.13048 7.49935 2.39825 8.23158C1.66602 8.96381 1.66602 10.1421 1.66602 12.4992V13.3325C1.66602 15.6895 1.66602 16.868 2.39825 17.6003C3.13048 18.3325 4.30899 18.3325 6.66602 18.3325H13.3327C15.6897 18.3325 16.8682 18.3325 17.6004 17.6003C18.3327 16.868 18.3327 15.6895 18.3327 13.3325V12.4992C18.3327 10.1421 18.3327 8.96381 17.6004 8.23158C16.8682 7.49935 15.6897 7.49935 13.3327 7.49935Z" fill="currentColor"/></g></svg>
</button>
</div>
</div>
<div class="rw-fullgallery__sidebar" data-rw-gallery-sidebar="">
<section class="rw-price" data-rw-price-block="">
<p class="rw-price__status rw-price__status--green"><span class="rw-price__dot" aria-hidden="true"></span>Active</p>
<p class="rw-price__amount">$480,000</p>
<ul class="rw-price__facts">
<li class="rw-price__fact"><svg class="rw-icon" viewBox="0 0 22 22" width="16" height="16" data-rw-icon="beds" focusable="false" aria-hidden="true"><g fill="none"><path d="M10.4 10.0448V7.52239H9.00002C8.22881 7.52239 7.71077 7.52363 7.32434 7.57403C6.95517 7.62218 6.79717 7.7054 6.69292 7.80654C6.58866 7.90768 6.50288 8.06096 6.45325 8.41911C6.4013 8.79401 6.40002 9.29659 6.40002 10.0448L10.4 10.0448Z" fill="currentColor"/><path d="M15.6 10.0448C15.6 9.29659 15.5987 8.79401 15.5468 8.41911C15.4972 8.06096 15.4114 7.90768 15.3071 7.80654C15.2029 7.7054 15.0449 7.62218 14.6757 7.57403C14.2893 7.52363 13.7712 7.52239 13 7.52239H11.6V10.0448L15.6 10.0448Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M11.8 5H10.2C7.18303 5 5.67454 5 4.73728 5.90928C3.9193 6.70284 3.8152 7.9185 3.80195 10.1607V11.4158C3.49768 11.5857 3.2576 11.8491 3.12179 12.1672C3 12.4524 3 12.8141 3 13.5373C3 14.2606 3 14.6222 3.12179 14.9074C3.28418 15.2878 3.59566 15.59 3.98771 15.7475C4.18962 15.8287 4.42864 15.8541 4.8 15.862V17.4179C4.8 17.7394 5.06863 18 5.4 18C5.73137 18 6 17.7394 6 17.4179V15.8657H16V17.4179C16 17.7394 16.2686 18 16.6 18C16.9314 18 17.2 17.7394 17.2 17.4179V15.862C17.5714 15.8541 17.8104 15.8287 18.0123 15.7475C18.4043 15.59 18.7158 15.2878 18.8782 14.9074C19 14.6222 19 14.2606 19 13.5373C19 12.8141 19 12.4524 18.8782 12.1672C18.7424 11.8491 18.5023 11.5857 18.1981 11.4158V10.1607C18.1848 7.9185 18.0807 6.70284 17.2628 5.90928C16.3255 5 14.817 5 11.8 5ZM16.8 11.2091V10.0044C16.8 9.30712 16.8001 8.72559 16.7361 8.26399C16.6686 7.77674 16.52 7.33684 16.1557 6.98334C15.7913 6.62984 15.3378 6.48574 14.8356 6.42023C14.3598 6.35817 13.7604 6.35819 13.0416 6.35821H8.95842C8.23964 6.35819 7.64026 6.35817 7.16444 6.42023C6.6622 6.48574 6.20876 6.62984 5.84439 6.98334C5.48001 7.33684 5.33148 7.77674 5.26395 8.26399C5.19998 8.72561 5.2 9.30709 5.20002 10.0044V11.2091C5.26357 11.209 5.33015 11.209 5.4 11.209H16.6C16.6699 11.209 16.7365 11.209 16.8 11.2091Z" fill="currentColor"/></g></svg>6 beds</li>
<li class="rw-price__fact"><svg class="rw-icon" viewBox="0 0 22 22" width="16" height="16" data-rw-icon="bath" focusable="false" aria-hidden="true"><g fill="none"><path d="M4.86047 5.33311C4.86047 4.66106 5.40528 4.11626 6.07733 4.11626C6.57491 4.11626 7.02237 4.4192 7.20716 4.88118L7.31379 5.14774C6.87136 5.47013 6.5099 5.91966 6.28724 6.46795C5.97445 7.23818 5.99132 8.06533 6.27278 8.77964C6.32816 8.92017 6.43812 9.03225 6.57756 9.0903C6.71701 9.14835 6.87403 9.1474 7.01276 9.08768L11.4487 7.17806C11.7256 7.05886 11.8578 6.7413 11.7473 6.46081C11.4657 5.74622 10.9159 5.13719 10.1603 4.8144C9.55652 4.55646 8.91592 4.52175 8.32557 4.67152L8.2436 4.46661C7.88928 3.58083 7.03137 3 6.07733 3C4.78877 3 3.74419 4.04457 3.74419 5.33311V10.4417H3.55814C3.24989 10.4417 3 10.6916 3 10.9999C3 11.3081 3.24989 11.558 3.55814 11.558H3.74419V11.7441C3.74419 11.7469 3.74421 11.7497 3.74425 11.7525C3.74418 11.7663 3.74418 11.7801 3.74419 11.7937L3.74419 11.8219C3.74419 12.1011 3.74419 12.2648 3.75577 12.4474C3.8614 14.1117 4.76078 15.6486 6.06424 16.6535C6.05401 16.6696 6.04451 16.6864 6.03579 16.7038L5.2916 18.1921C5.15375 18.4678 5.2655 18.8031 5.54121 18.941C5.81692 19.0788 6.15218 18.9671 6.29004 18.6914L7.0102 17.251C7.60683 17.553 8.25567 17.7518 8.9305 17.8201C9.11241 17.8385 9.22344 17.8427 9.41256 17.8498L9.41763 17.85C9.9685 17.8707 10.5077 17.8835 11 17.8835C11.4923 17.8835 12.0315 17.8707 12.5824 17.85L12.5874 17.8498C12.7765 17.8427 12.8876 17.8385 13.0695 17.8201C13.7444 17.7518 14.3933 17.553 14.99 17.251L15.7102 18.6914C15.8481 18.9671 16.1833 19.0788 16.459 18.941C16.7347 18.8031 16.8465 18.4678 16.7086 18.1921L15.9645 16.7038C15.9557 16.6863 15.9462 16.6695 15.9359 16.6534C17.2393 15.6485 18.1386 14.1117 18.2442 12.4474C18.2558 12.2649 18.2558 12.1012 18.2558 11.8219L18.2558 11.7937C18.2559 11.749 18.2559 11.7025 18.2531 11.6596C18.2509 11.6253 18.2473 11.5915 18.2425 11.558H18.4419C18.7501 11.558 19 11.3081 19 10.9999C19 10.6916 18.7501 10.4417 18.4419 10.4417H4.86047V5.33311Z" fill="currentColor"/></g></svg>5 baths</li>
<li class="rw-price__fact"><svg class="rw-icon" viewBox="0 0 22 22" width="16" height="16" data-rw-icon="square" focusable="false" aria-hidden="true"><g fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.02513 5.02513C4 6.05025 4 7.70017 4 11C4 14.2998 4 15.9497 5.02513 16.9749C6.05025 18 7.70017 18 11 18C14.2998 18 15.9497 18 16.9749 16.9749C18 15.9497 18 14.2998 18 11C18 7.70017 18 6.05025 16.9749 5.02513C15.9497 4 14.2998 4 11 4C7.70017 4 6.05025 4 5.02513 5.02513ZM10.1232 6.79555C10.1256 7.08549 9.89256 7.32252 9.60263 7.32498C9.00351 7.33006 8.58507 7.34985 8.27026 7.41152C7.9701 7.47031 7.80396 7.55998 7.68197 7.68197C7.55998 7.80396 7.47031 7.9701 7.41152 8.27026C7.34985 8.58507 7.33006 9.00351 7.32498 9.60263C7.32252 9.89256 7.08549 10.1256 6.79555 10.1232C6.50561 10.1207 6.27256 9.88366 6.27502 9.59372C6.28007 8.99824 6.2985 8.49011 6.3811 8.06842C6.46657 7.63208 6.62721 7.2518 6.93951 6.93951C7.2518 6.62721 7.63208 6.46657 8.06842 6.3811C8.49011 6.2985 8.99824 6.28007 9.59372 6.27502C9.88366 6.27256 10.1207 6.50561 10.1232 6.79555ZM11.8751 6.79555C11.8776 6.50561 12.1146 6.27256 12.4046 6.27502C13 6.28007 13.5082 6.2985 13.9299 6.3811C14.3662 6.46657 14.7465 6.62721 15.0588 6.93951C15.3711 7.2518 15.5317 7.63208 15.6172 8.06842C15.6998 8.49011 15.7182 8.99824 15.7233 9.59372C15.7257 9.88366 15.4927 10.1207 15.2027 10.1232C14.9128 10.1256 14.6758 9.89256 14.6733 9.60263C14.6682 9.00351 14.6484 8.58507 14.5868 8.27026C14.528 7.9701 14.4383 7.80396 14.3163 7.68197C14.1943 7.55998 14.0282 7.47031 13.728 7.41152C13.4132 7.34985 12.9948 7.33006 12.3957 7.32498C12.1057 7.32252 11.8727 7.08549 11.8751 6.79555ZM7.32498 12.396C7.32252 12.1061 7.08549 11.873 6.79555 11.8755C6.50561 11.8779 6.27256 12.115 6.27502 12.4049C6.28007 13.0004 6.2985 13.5085 6.3811 13.9302C6.46657 14.3666 6.62721 14.7468 6.93951 15.0591C7.2518 15.3714 7.63208 15.5321 8.06842 15.6175C8.49011 15.7001 8.99824 15.7186 9.59372 15.7236C9.88366 15.7261 10.1207 15.493 10.1232 15.2031C10.1256 14.9131 9.89256 14.6761 9.60263 14.6737C9.00351 14.6686 8.58507 14.6488 8.27026 14.5871C7.9701 14.5283 7.80396 14.4387 7.68197 14.3167C7.55998 14.1947 7.47031 14.0285 7.41152 13.7284C7.34985 13.4136 7.33006 12.9951 7.32498 12.396ZM15.2027 11.8755C15.4927 11.8779 15.7257 12.115 15.7233 12.4049C15.7182 13.0004 15.6998 13.5085 15.6172 13.9302C15.5317 14.3666 15.3711 14.7468 15.0588 15.0591C14.7465 15.3714 14.3662 15.5321 13.9299 15.6175C13.5082 15.7001 13 15.7186 12.4046 15.7236C12.1146 15.7261 11.8776 15.493 11.8751 15.2031C11.8727 14.9131 12.1057 14.6761 12.3957 14.6737C12.9948 14.6686 13.4132 14.6488 13.728 14.5871C14.0282 14.5283 14.1943 14.4387 14.3163 14.3167C14.4383 14.1947 14.528 14.0285 14.5868 13.7284C14.6484 13.4136 14.6682 12.9951 14.6733 12.396C14.6758 12.1061 14.9128 11.873 15.2027 11.8755Z" fill="currentColor"/></g></svg>6,838 sq ft</li>
</ul>
<p class="rw-price__address">1417 Sterlingbrooke Dr SW, Powder Springs, GA 30127</p>
</section>
<div class="rw-fullgallery__sticky">
<div class="rw-contactcards" data-rw-contact-cards="">
<div class="rw-agentcard" data-rw-agent-card="">
<div class="rw-agentcard__who">
<span class="rw-avatar rw-avatar--48 rw-avatar--dark" aria-hidden="true">JL</span>
<p class="rw-agentcard__name">Jordan Lee</p>
</div>
<h2 class="rw-agentcard__title">Questions about this home?</h2>
<p class="rw-agentcard__text">We are ready to answer any questions you have about this home, or to schedule a tour if you want to see it in person.</p>
<button type="button" class="rw-button rw-button--block" data-rw-open="contact">Contact Jordan Lee</button>
</div>
<div class="rw-tourcard" data-rw-tour-card="">
<h2 class="rw-tourcard__title">Schedule a tour</h2>
<p class="rw-tourcard__text">Choose a day and time that works for you to see this home in person or by video.</p>
<button type="button" class="rw-button rw-button--accent rw-button--block" data-rw-open="tour">Choose tour time</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="rw-fullgallery__bar">
<div class="rw-mobilebar" data-rw-mobile-bar="">
<button type="button" class="rw-button rw-button--block" data-rw-open="contact">Contact Jordan Lee</button>
<button type="button" class="rw-button rw-button--accent rw-button--block" data-rw-open="tour">Choose tour time</button>
</div>
</div>
<dialog class="rw-lightbox" aria-label="Photo gallery" data-rw-lightbox="">
<button type="button" class="rw-lightbox__close" aria-label="Close the photo gallery" data-rw-lightbox-close="">
<svg class="rw-icon" viewBox="0 0 24 24" width="20" height="20" data-rw-icon="close" focusable="false" aria-hidden="true"><g fill="none"><g clip-path="url(#rw-close-clip0_4_13476)"><path d="M18.3002 5.7107C17.9102 5.3207 17.2802 5.3207 16.8902 5.7107L12.0002 10.5907L7.11022 5.7007C6.72022 5.3107 6.09021 5.3107 5.70021 5.7007C5.31021 6.0907 5.31021 6.7207 5.70021 7.1107L10.5902 12.0007L5.70021 16.8907C5.31021 17.2807 5.31021 17.9107 5.70021 18.3007C6.09021 18.6907 6.72022 18.6907 7.11022 18.3007L12.0002 13.4107L16.8902 18.3007C17.2802 18.6907 17.9102 18.6907 18.3002 18.3007C18.6902 17.9107 18.6902 17.2807 18.3002 16.8907L13.4102 12.0007L18.3002 7.1107C18.6802 6.7307 18.6802 6.0907 18.3002 5.7107Z" fill="currentColor"/></g><defs><clipPath id="rw-close-clip0_4_13476"><rect width="24" height="24" fill="currentColor"/></clipPath></defs></g></svg>
</button>
<button type="button" class="rw-lightbox__step rw-lightbox__step--prev" aria-label="Previous photo" data-rw-lightbox-prev="">
<svg class="rw-icon" viewBox="0 0 24 24" width="24" height="24" data-rw-icon="chevron-left" focusable="false" aria-hidden="true"><g fill="none"><path d="M15 5L8 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 5L8 12L15 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></g></svg>
</button>
<button type="button" class="rw-lightbox__step rw-lightbox__step--next" aria-label="Next photo" data-rw-lightbox-next="">
<svg class="rw-icon" viewBox="0 0 24 24" width="24" height="24" data-rw-icon="chevron-right" focusable="false" aria-hidden="true"><g fill="none"><path d="M9 5L16 12L9 19" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></g></svg>
</button>
</dialog>
</dialog>import { FullGallery, ContactCards, MobileActionBar } from "@ruuster/idx-recipes";
<FullGallery {...props} />
<ContactCards {...props} />
<MobileActionBar {...props} />
How it opens
Every button that opens the gallery carries data-rw-open="gallery", and the gallery listens for
clicks on those buttons inside the listing page's root element (data-rw-detail). On the listing
page these buttons open it:
| Button | Opens |
|---|---|
| A photo in the photo grid | The Photos tab, scrolled to that photo |
| The "N photos" badge | The Photos tab at the first photo |
| The "Street view" pill | The Street view tab |
A button can name the tab and the photo with data-rw-open-tab="photos" or "street" and
data-rw-open-index="3". A request for a photo the listing does not have opens the top of the
Photos tab, and a request for Street view on a home with no Street view tab opens the Photos tab.
While the gallery is open the page behind it stays still. The X button and the Escape key close it, and the keyboard focus goes back to the button that opened it.
The Photos tab
The photos sit in a mosaic with rounded corners:
- Under 768 pixels, one column of photos at 4:3.
- From 768 pixels, the first photo and every third photo after it fill the width at 16:9, and the others sit two to a row at 4:3. When one photo would be left alone on its row, it fills the width.
Photos load as the visitor scrolls, at the size the screen needs. Each photo is a button named "Open photo 3 of 24", which opens the lightbox at that photo.
The lightbox
The lightbox shows one photo at a time with "3 of 24" under it. The arrow buttons, the left and right arrow keys, and a swipe of 50 pixels on a touch screen move to the next or the previous photo, and both ends wrap around. The X button and the Escape key close it, and the focus goes back to the photo that opened it.
The Street view tab
The Street view tab appears when you pass your Google Maps key, the listing has coordinates, and its address is shown. It loads Google Street View at the nearest outdoor view within 50 meters of the home. While the view loads the tab reads "Street view is loading." When Google has no imagery for the address, it reads "There is no street view imagery for this address. The Photos tab has every photo of this home." The sidebar steps aside on this tab, so the view has the full width.
The header, the sidebar and the mobile bar
- The header stays at the top of the gallery. It holds the tabs and, from 768 pixels, a dark "Share" button when the page has a share link, then the X button. Once the price block in the sidebar scrolls out of view (on a phone, after 50 pixels), the tabs give way to a summary with the price, the address, beds, baths and square feet.
- The sidebar, from 992 pixels, holds the price block and, below it, the contact and tour cards, which stay in view as the visitor scrolls.
- On a phone, the share button floats over the photos, and under 992 pixels the contact and tour buttons stay fixed at the bottom of the screen, as on the listing page.
Use it on your own layout
ListingDetail passes the gallery its sidebar and its mobile bar. On a layout of your own, mount
FullGallery once inside the element that carries data-rw-detail, next to any buttons that open
it:
packages/ruuster-idx-recipes/snippets/own-listing-layout.tsx
// Your own listing layout from the pieces ListingDetail is made of. The screens open from any button
// with data-rw-open inside the element that carries data-rw-detail, so mount each screen once inside
// that element and put your buttons anywhere in it.
import type { ListingDetail as ListingDetailData } from "@ruuster/idx";
import { ContactAgentModal, ContactCards, FullGallery, PhotoGrid, PriceBlock, RequestTourModal, ShareModal } from "@ruuster/idx-recipes";
const AGENT = { name: "Jordan Lee", phone: "(404) 555-0134", email: "jordan@peachrealty.example", brokerage: "Peach Realty" };
const CONSENT = "I agree that Peach Realty may call, text or email me about this home. I can opt out at any time.";
export function MyListingLayout({ listing, pageUrl }: { listing: ListingDetailData; pageUrl: string }) {
return (
<article className="rw-recipes my-listing" data-rw-detail={listing.id}>
<PhotoGrid photos={listing.photos} fallbackAlt={listing.address.display} streetView={false} share />
<div className="my-listing__columns">
<PriceBlock listing={listing} />
<aside>
<ContactCards agent={AGENT} />
{/* Any button of your own opens a screen the same way. */}
<button type="button" className="my-button" data-rw-open="tour">
Pick a tour time
</button>
</aside>
</div>
<FullGallery listing={listing} share />
<ShareModal listing={listing} url={pageUrl} />
<ContactAgentModal listing={listing} agent={AGENT} action="/api/leads/fub" consentText={CONSENT} />
<RequestTourModal listing={listing} action="/api/leads/fub" consentText={CONSENT} />
</article>
);
}
FullGallery
| Prop | Type | Required | What it does |
|---|---|---|---|
listing |
ListingDetail or ListingCard |
Yes | The listing whose photos the gallery shows |
share |
boolean |
Yes | Shows the Share button, which opens the share screen |
googleMapsKey |
string | null |
No | Your Google Maps key. With coordinates and a shown address it adds the Street view tab |
sidebar |
ReactNode |
No | The content under the price block from 992 pixels, such as ContactCards |
mobileBar |
ReactNode |
No | The bar fixed to the bottom under 992 pixels, such as MobileActionBar |
Lightbox
FullGallery opens the lightbox itself. Use Lightbox on its own when your layout shows photos
without the gallery.
| Prop | Type | Required | What it does |
|---|---|---|---|
photos |
Photo[] |
Yes | listing.photos |
fallbackAlt |
string |
Yes | The alt text for a photo without its own |
index |
number | null |
Yes | The photo to show, or null when the lightbox is closed |
onIndex |
(index: number | null) => void |
Yes | Called with the next photo, or null when the visitor closes it |
returnFocusTo |
HTMLElement | null |
No | The element that gets the focus back on close |
Rules this screen follows
MUST
- Keep every photo's alt text from the API. It never names the street of a hidden address.
- Show the Street view tab only with your own Google Maps key, restricted to your domains.
NEVER
- Show Street view or coordinates for a listing whose address is hidden.
FullGalleryshows the tab only when the address is shown.
Without React
The static listing page in Build without React prints
the gallery closed, with every photo in it, and ruuster-idx.js opens it from the same
data-rw-open buttons. static/HOOKS.md in @ruuster/idx-recipes lists every hook the script reads.