# GuestDrop website embed

Show a GuestDrop event on any website: an upload button for guests, a photo gallery, a slideshow, or all three with a switch at the top. This page is the full reference for the embed code, written for coding agents and developers.

Source of truth: https://staging.guestdrop.app/docs/embed.md

## Quick start

```html
<div data-guestdrop="EVENT_ID" data-view="gallery"><a href="https://staging.guestdrop.app/">GuestDrop</a></div>
<script src="https://staging.guestdrop.app/embed.js" async></script>
```

- `EVENT_ID` is the event's ID. The creator gets the full snippet from the GuestDrop dashboard (event, Share, Add to your website). It is also the last part of the guest upload link, `https://staging.guestdrop.app/u/EVENT_ID`.
- The script finds every `[data-guestdrop]` element, puts an iframe in it, sizes the iframe to its content, opens photos full screen over the page, and styles the link as a small credit badge.
- Load the script once per page, anywhere. Several embeds on one page share it.
- The link inside the div is the credit and the no-script fallback. Keep it.

## Options

Set these as attributes on the `data-guestdrop` element. All are optional except `data-guestdrop`. The script reads them once, when it first sees the element.

| Attribute | Values | Default | What it does |
| --- | --- | --- | --- |
| `data-guestdrop` | event ID | (required) | Which event to show. |
| `data-views` | comma list of `upload`, `gallery`, `slideshow` | all three | Views guests can switch between. With one view there is no switch. |
| `data-view` | `upload`, `gallery`, `slideshow` | `gallery` | The view that opens first. If it is not in `data-views`, the first listed view opens. |
| `data-height` | 200 to 2000 (px) | auto | Fixed height. Without it the embed grows and shrinks to fit its content. |
| `data-theme` | `light`, `dark` | follows the visitor's device | Color scheme inside the embed. Match the site's background. |
| `data-accent` | hex color, like `#5F0F40` | GuestDrop orange | Buttons, the active tab and links. Use the site's main button or link color. Text on it switches between light and dark to stay readable. |
| `data-font` | `sans`, `serif` | `sans` | `serif` switches to the device's classic serif (Iowan Old Style on Apple devices, Palatino or Georgia elsewhere), with no font download. Use it when the site's type is serif. |
| `data-surface` | `card`, `none` | `card` | `none` drops the white card, border and shadow, so the site's own background shows through. |
| `data-heading` | `on`, `off` | `on` | `off` hides the event name inside the embed. Use it when the site already has a heading above the embed. |
| `data-max-width` | px | none (full width) | Caps the width and centers the embed. |
| `data-radius` | 0 to 64 (px) | 20 | Corner radius of the embed. |
| `data-credit` | `pill`, `text` | `pill` | `text` leaves the credit as a plain small link that takes the site's own link style. |
| `data-title` | text | `Guest photos` | The iframe's accessible title. |

`data-mode` and `data-modes` are accepted as aliases of `data-view` and `data-views`.

## Views

- **upload**: the event name, a short line and an Upload photos button. On wide layouts a QR code sits next to it so desktop visitors can scan with their phone. Guests upload on GuestDrop in a new tab. No app, no sign-up.
- **gallery**: the newest photos and videos in a grid. Tapping one opens it full screen over the site, with swipe, keyboard and a link to the full gallery.
- **slideshow**: recent photos one at a time with a slow crossfade. It picks up new photos every few minutes and pauses when off screen.

Gallery and slideshow only show for events whose gallery is public. For a private or protected event they drop out of the switch and the embed shows the upload view. After the event's gallery closes, every view shows a short "This gallery has closed" card, so the site never looks broken.

## Recipes

Upload only:

```html
<div data-guestdrop="EVENT_ID" data-view="upload" data-views="upload"><a href="https://staging.guestdrop.app/">GuestDrop</a></div>
```

Gallery and upload, no slideshow, opening on the gallery:

```html
<div data-guestdrop="EVENT_ID" data-view="gallery" data-views="upload,gallery"><a href="https://staging.guestdrop.app/">GuestDrop</a></div>
```

A 500px slideshow in a dark section:

```html
<div data-guestdrop="EVENT_ID" data-view="slideshow" data-views="slideshow" data-height="500" data-theme="dark"><a href="https://staging.guestdrop.app/">GuestDrop</a></div>
```

Match the site (recommended when the embed sits in a styled section with its own heading):

```html
<div data-guestdrop="EVENT_ID" data-view="gallery" data-accent="#5F0F40" data-font="serif" data-surface="none" data-heading="off" data-theme="light"><a href="https://staging.guestdrop.app/">GuestDrop</a></div>
```

A narrow, square-cornered embed with a plain credit link:

```html
<div data-guestdrop="EVENT_ID" data-max-width="640" data-radius="0" data-credit="text"><a href="https://staging.guestdrop.app/">GuestDrop</a></div>
```

Each recipe also needs the script tag once on the page.

## Frameworks

The div is plain markup; the script does the rest, including for embeds that render after it loads (client-side routing, lazy sections).

React and Next.js. Render the div's inner link with `dangerouslySetInnerHTML` so React does not fight the script over the iframe it inserts, and load the script with `next/script`:

```tsx
import Script from 'next/script'

export function GuestPhotos() {
  return (
    <>
      <div
        data-guestdrop="EVENT_ID"
        data-view="gallery"
        dangerouslySetInnerHTML={{ __html: '<a href="https://staging.guestdrop.app/">GuestDrop</a>' }}
      />
      <Script src="https://staging.guestdrop.app/embed.js" strategy="afterInteractive" />
    </>
  )
}
```

Vue, Svelte, Astro: put the div in the template and add the script tag once (Astro: `<script is:inline src="…" async></script>`).

## Website builders

- Squarespace: add a Code block, paste the snippet, keep the mode on HTML and turn off Display source. Needs the Core, Plus or Advanced plan.
- Wix: Add Elements, Embed code, Embed HTML, then Enter code. Wix puts the code in a box of its own that cannot resize, so set `data-height` and drag the box to the same height.
- WordPress.com: Custom HTML block. Needs a paid plan with hosting features; the free plan strips the code.
- Carrd: Embed element, Type Code, Style Inline. Needs Pro Standard or higher.
- Builders that strip scripts or take only a URL (Notion, Google Sites, some plans above): use the iframe-only code below.
- Zola, The Knot, Joy and Minted do not accept embed code. Link to the guest upload page instead.

## Iframe only (no script)

```html
<iframe src="https://staging.guestdrop.app/embed/EVENT_ID/gallery#views=upload,gallery,slideshow" title="Guest photos" width="100%" height="640" loading="lazy" style="border:0;border-radius:20px"></iframe>
<p style="text-align:center;font-size:12px"><a href="https://staging.guestdrop.app/">GuestDrop</a></p>
```

- The path's last segment is the starting view.
- The hash takes `views` (comma list), `theme` (`light` or `dark`), `accent` (6-digit hex, no `#`), `font=serif`, `surface=none` and `heading=off`. Without `views`, only the starting view shows, with no switch.
- The height is fixed: content taller than the iframe scrolls inside it. Photos open on GuestDrop in a new tab instead of full screen over the page.

## Content Security Policy

If the site sends a CSP header, allow the GuestDrop origin:

```
frame-src https://staging.guestdrop.app;
script-src https://staging.guestdrop.app;
img-src https://staging.guestdrop.app;
```

## Privacy and performance

- The embed sets no cookies and uses no local storage on the visitor's device, so it needs no cookie banner entry.
- The script is under 25 KB, loads async, and the iframe is lazy-loaded.
- Media is served from GuestDrop's CDN. Hidden or deleted photos leave the embed within about a minute.

## Do not

- Do not change the iframe path or the script URL. They are tied to GuestDrop's origin.
- Do not copy GuestDrop images or video URLs into the site. They expire with the event's retention.
- Do not wrap the embed in an element with a fixed height and `overflow:hidden` unless you also set `data-height`.
- Do not remove the credit link from the div. It is the fallback when scripts are blocked.

## Troubleshooting

- Nothing shows: check the event ID, that the script tag is on the page, and the browser console for a CSP error.
- The box stays empty-gray: the iframe is still loading or was blocked; it fades in when the embed reports its size.
- Only the upload view shows: the event's gallery is not public. The creator can make it public in event settings.
- The embed is cut off: a parent has a fixed height or `overflow:hidden`. Remove it or set `data-height`.
