Big Hero · Gallery Infinite Scroll

Connect Gallery Collection

Pipe a Framer CMS Gallery field into the Big Hero gallery with a single Code Override. Every photo you add to the Collection shows up in the scroll track — no per-image hand-pasting.

How it works

Framer's ControlType.CollectionReference is a Plugin-only control — it doesn't appear in code-component property controls. The bridge we use instead: a Code Override on your CMS Gallery field's rendered Image emits a hidden <div data-bighero="gallery" data-imageurl="…"> for every photo. The Big Hero Gallery component (Source: CMS) listens for these via MutationObserver and reads the URLs into its scroll track.


Setup (4 steps)

  1. Create a Collection with a Gallery field

    Framer CMS: create collection with Gallery field, add images, go to Collection page detail, insert Fields > Gallery into canvas.

    Add a "Gallery" field to your Collection, upload images, open the Collection detail page, then insert Fields → Gallery onto the canvas.

    Framer's Gallery field type is a built-in multi-image field — one field holds many photos per item. When you drop the Gallery field on the Collection detail page, Framer renders one Image element per uploaded photo.
  2. Add a Code Override file

    Framer Assets > Code: create new file as Override, name it OverrideGetGalleryImageURL, paste the bridge snippet.

    Assets → Code → + → New Override, name it OverrideGetGalleryImageURL, then paste the snippet below.

    import { type ComponentType } from "react"
    
    export function withBigHeroGalleryBridge(_: ComponentType): ComponentType {
      return (props) => {
        // Image elements in Framer carry the URL on props.background.src
        // (or props.src for plain image instances). Field name in CMS
        // doesn't matter — the override only sees the rendered Image.
        const url =
          (props as any)?.background?.src ??
          (props as any)?.src
        return url ? (
          <div
            hidden
            aria-hidden="true"
            data-bighero="gallery"
            data-imageurl={url}
          />
        ) : null
      }
    }
    Note: the override returns only the hidden bridge div and drops the visible image — that's intentional. The visible gallery you'll see on the page is the Big Hero component (Step 4), not the Collection's list rendering.
  3. Apply the override to the Gallery's Image

    Framer layer tree: select Image inside Gallery, right panel Code Overrides set File = OverrideGetGalleryImageURL and Override = withBigHeroGalleryBridge.

    Select the Image inside the inserted Gallery field, then in Code Overrides pick File = OverrideGetGalleryImageURL and Override = withBigHeroGalleryBridge.

    Each item in the Gallery field now emits a hidden bridge node into the DOM. The visible images will vanish from the canvas — expected. The next step turns them back on through the Big Hero Gallery component.
  4. Switch the Big Hero Gallery to CMS mode

    Big Hero Gallery Infinite Scroll properties panel: Source segmented control set to CMS.

    Select the Big Hero Gallery component on the same page and flip Source: CMS in the properties panel.

    The gallery immediately reads the bridge nodes and scrolls through every photo in the Collection's Gallery field. Add or remove items in the CMS and the gallery updates live — MutationObserver keeps the bridge in sync.

Notes & gotchas


What's next

v1 of the Big Hero plugin ships the Gallery component only. Three additional R3F variants — a morphing Liquid Blob, a cursor-reactive Particle Field, and a Flying 3D hero with marquee modes — are already in the bundle as code, and will land as insertable components in a future release once they pass another polish pass.