# Before / After Slider: Frame element for AI agents

> Before / after: one floating card holds both photos; a glossy orb knob glides across and the 'after' is revealed behind the slider line, with before/after pills on the corners

Canonical page: https://agentframes.ai/elements/orbit/before-after/
Markdown: https://agentframes.ai/elements/orbit/before-after.md

## Overview

- Name: Before / After Slider (`beforeAfter`), an element: one HyperFrames block per size
- Part of: the [Orbit](https://agentframes.ai/packs/orbit.md) pack (5 of 47). Available only through the All-access subscription.
- Category: Frame
- Purpose: Before / after: one floating card holds both photos; a glossy orb knob glides across and the 'after' is revealed behind the slider line, with before/after pills on the corners
- Pack: [Orbit](https://agentframes.ai/packs/orbit.md), included in All-access (from $14/month billed annually ($168/year), or $19 monthly)
- Subscribe: POST https://agentframes.ai/api/checkout/subscribe with interval=month or interval=year (optional currency=USD|GBP|EUR|AUD|CAD; 303 redirect to Stripe checkout; a human pays there). Then download any pack with the subscriber key: https://agentframes.ai/account.md
- Aspects: 16:9 (native), 9:16 (native), 4:5 (native), 1:1 (native)
- Canvases: works on mist (plain canvas) (`m`), mist + dot grids (`d`), white (`w`), ice (second tint) (`i`), gradient field (`v`), night (deep + glow) (`k`); avoid none
- Typical duration: 4s
- Speaker-safe: no
- Preview video (watermarked): https://agentframes.ai/media/orbit/before-after.mp4
- Poster: https://agentframes.ai/media/orbit/before-after.jpg
- Licence: [AgentFrames Licence](https://agentframes.ai/licence.md)

## Paste this into Claude Code

```text
Use the AgentFrames Orbit pack. Add a `beforeAfter` beat to plan.json on a `m` canvas with slots `title`, `before`, `after`, `posB`, `posA`, `labels` and `split` from my script. Then run validate → build → qa and show me qa/contact.jpg.
```

## Variables

| Variable | Type | Label | Description | Default |
|---|---|---|---|---|
| `title` | string | Title | Plain text. | flat vs *gradient* |
| `before` | string | Before | Plain text. | photos/ugc-2.jpg |
| `after` | string | After | Plain text. | photos/ugc-1.jpg |
| `posB` | string | Pos B | Plain text. | 50% 50% |
| `posA` | string | Pos A | Plain text. | 50% 50% |
| `labels` | string | Labels | JSON string; see constraints.json. | ["before","after"] |
| `split` | number | Split | Plain text. | 0.5 |

## What your agent can change

Before / after: one floating card holds both photos; a glossy orb knob glides across and the 'after' is revealed behind the slider line, with before/after pills on the corners

Native 1920x1080, eight seconds at 30fps. Use the matching native aspect variant; do not stretch a finished scene.

### Author and mount

The HTML is editable HyperFrames source. Change its native variable declarations or mount it with a unique host id, data-composition-id="af-orbit-before-after-16x9", data-composition-src="compositions/af-orbit-before-after-16x9.html" and data-variable-values. Copy every manifest file to its target and include the af-orbit-runtime dependency. The shipped projects already install this closure; private ZIP delivery supplies no hosted add endpoint.

### Content

- ground (enum):  Default "canvas"
- title (string): Plain text. Default "flat vs *gradient*"
- before (string): Plain text. Default "photos/ugc-2.jpg"
- after (string): Plain text. Default "photos/ugc-1.jpg"
- posB (string): Plain text. Default "50% 50%"
- posA (string): Plain text. Default "50% 50%"
- labels (string): JSON string; see constraints.json. Default "[\"before\",\"after\"]"
- split (number): Plain text. Default 0.5

Arrays and objects are JSON strings at the native boundary. constraints.json describes their decoded shape and numeric/text limits; failures report orbitError on the root and an actionable console message. n is zero-based and must index the supplied slides or covers. Export a settled frame at 2.4s for stills; change n and repeat for a carousel deck/highlight set. Thumbnail layout accepts face, versus and list.

### Creator and palette

creator, handle, channel, tagline, colourway (lilac/citrus/coral), accent (empty or six-digit hex), monogram (1-3 characters), logo, avatar, subscribers, ctaFollow, ctaLink, ctaCode are instance-local. Blank automatic name/by/sign/button/etc slots derive from the current kit rather than preserving the fictional demo creator. Image paths can be local project assets, https URLs or inline data; ship new local images in the manifest. Bundled photos are generated fictional example media.

### Geometry and timing

Full native canvas is the default. stageX, stageY, stageWidth, stageHeight place the design in an authored speaker zone, within the canvas; stageKind=full/gfx/dock selects its native composition logic and stageSpeaker describes the speaker side. transparent clears the outer canvas for overlays. delay offsets the entrance; sceneDuration supplies the visible beat length (0.1-8s), and delay must be shorter. Motion is paced for reading on a talking-head video and automatically tightens to finish inside a short sceneDuration; the design draws out over its final 0.4s. Where the design has a cues input, set it from the transcript so each item lands as it is spoken. The block owns a paused eight-second timeline; clip a shorter beat at its parent mount. Extend HTML duration, manifest duration and timeline hold together for longer scenes.

The runtime helper creates local tokens and drawing state for each host. It preserves GSAP frame quantization and deterministic hooks; no plan.json, global OC brand or proprietary build tool is required. See the pack licence, HyperFrames NOTICE and local font licences.

## FAQ

### What can my AI agent change in Before / After Slider?

Your agent fills the `title`, `before`, `after`, `posB`, `posA`, `labels` and `split` slots through the block's data-variable-values (or the starter project's variables). Motion, timing, palette, fonts and the internal layout are protected, so the result keeps the Orbit look.

### Which aspect ratios does Before / After Slider support?

Before / After Slider is designed natively for 16:9, 9:16, 4:5 and 1:1. A typical beat lasts 4s.

### How do I get Before / After Slider?

Before / After Slider is included in the Orbit pack, which is part of the AgentFrames All-access subscription along with 46 other templates in this pack and every other pack on the store. You get the full source, the editing contracts and the agent instructions.

## More in Orbit

- [Eyedropper Colour Picker](https://agentframes.ai/elements/orbit/colour-picker.md): Eyedropper: a photo lands in a floating card, a picker loupe glides over it and samples a spot, then a swatch orb of that colour grows out with its hex and a name
- [B-Roll Floating Frame](https://agentframes.ai/elements/orbit/pip-frame.md): B-roll / photo frame: the creator's shot lands in a tilted floating white card (lift-off), orbs slide out from behind its corners, the photo eases in and a caption pill pops on its edge
- [Collab / Ad Tag](https://agentframes.ai/elements/orbit/ad-tag.md): Collab / ad disclosure tag, docked: two circle avatars slide together and overlap (creator + partner) with a small x orb between them, and a white pill slides out: 'ad · with Hue & Co'. The partner is fictional by default
- [Curved Arrow Sticker](https://agentframes.ai/elements/orbit/arrow-sticker.md): Arrow sticker: a soft curved gradient arrow draws itself toward a point, its head appears and a white label pill sits at its tail. Point at the comments, the link or yourself

## Community

Coming soon.
