Files
hyperframes/docs/catalog/components/panel-reveal.mdx
T
Ular Kimsanov a06fdfe26e docs(catalog): put each item page's title, description and Docs text in the server HTML (#6711)
* docs(catalog): put each item page's title, description and Docs text in the server HTML

Mintlify renders snippet components in the browser only, so everything inside
CatalogDetail (title, standfirst, the Docs tab) was missing from the HTML search
engines read: 448 catalog pages served Googlebot no body text. The generator now
writes the H1 and standfirst as page markup above the component and the Docs tab
as page markup after it, shown with that tab (docs/custom.css). The component no
longer draws its own title. Pages patched structurally only; registry drift on 14
pages is left for a regeneration of its own.

* docs(catalog): keep the title's top spacing the component gave it

* fix(docs): catalog titles and descriptions keep markdown markers literal

MDX reads text inside the static <h1> and <p> as inline markdown, so @_blue_sweater_
rendered as italic blue_sweater. mdxText now writes backslash, backtick, * _ [ ] ~ as
character references too, with a unit test; the four affected pages are re-escaped.
2026-10-30 15:48:25 +00:00

221 lines
9.1 KiB
Plaintext

---
title: "Panel Reveal"
description: "A panel reveal primitive with height expansion and content fade"
mode: "frame"
---
import { CatalogDetail, CatalogSlot } from "/snippets/catalog-detail.jsx";
import { InstallCommand } from "/snippets/install-command.jsx";
<div className="hf-ve-static-head not-prose">
<h1>Panel Reveal</h1>
<p>A panel reveal primitive with height expansion and content fade</p>
</div>
<CatalogDetail
previewSrc="/public/catalog/components/panel-reveal.json"
compositionId="panel-reveal"
compositionSrc="compositions/components/panel-reveal.html"
title="Panel Reveal"
variables={[{"id":"title","type":"string","role":"content","label":"Title","description":"The header line that sits above the folded body.","default":"Motion tokens"},{"id":"width","type":"enum","role":"layout","label":"Width","description":"How wide the panel sits, 280, 360 or 480 px.","default":"standard","options":[{"value":"narrow","label":"Narrow"},{"value":"standard","label":"Standard"},{"value":"wide","label":"Wide"}]},{"id":"tone","type":"enum","role":"style","label":"Tone","description":"Surface family: paper is the white card for light frames, ink inverts it for dark frames.","default":"paper","options":[{"value":"paper","label":"Paper"},{"value":"ink","label":"Ink"}]},{"id":"reveal","type":"enum","role":"motion","label":"Reveal","description":"Whether the body fades in with the height. fade is the shipped motion, solid opens the height only.","default":"fade","options":[{"value":"fade","label":"Fade"},{"value":"solid","label":"Solid"}]}]}
meta={{"category":"Effects","badge":"Stable","codeLines":133}}
attribution={{"path":"registry/components/panel-reveal","tags":["transition-primitive","transitions-dev-port","panel","reveal"]}}
hasCode
rawUrl="https://raw.githubusercontent.com/heygen-com/hyperframes/main/registry/components/panel-reveal/panel-reveal.html"
>
<CatalogSlot slot="code">
```html panel-reveal.html
<!--
Panel Reveal - transitions.dev-inspired primitive for HyperFrames.
Paste the markup, CSS and script into a composition. Use the timeline
integration note at the bottom as the starting point for deterministic GSAP
animation.
Variables. The script reads each one, falls back to the declared default on
anything missing or unrecognised, and writes the result as a custom property
the CSS below consumes. The timeline recipe at the end is untouched by them:
it keeps driving the single open value from 0 to 1.
- title (string, default "Motion tokens"): the header line above the fold.
- width (narrow | standard | wide, default standard): how wide the panel
sits, 280, 360 or 480 px.
- tone (paper | ink, default paper): the surface family. paper is the
white card on a light frame, ink is the same card inverted for dark
frames, border and body copy included.
- reveal (fade | solid, default fade): whether the body fades in with the
height. fade is the shipped motion, solid keeps the body at full opacity
so only the height opens. Both look the same once the panel is open.
On every default the result is identical to the original: a 360px white card
whose body fades in as it grows.
-->
<section
class="hf-transition-panel-reveal"
data-composition-variables='[
{ "id": "title", "type": "string", "role": "content", "label": "Title", "description": "The header line that sits above the folded body.", "default": "Motion tokens" },
{ "id": "width", "type": "enum", "role": "layout", "label": "Width", "description": "How wide the panel sits, 280, 360 or 480 px.", "default": "standard", "options": [{ "value": "narrow", "label": "Narrow" }, { "value": "standard", "label": "Standard" }, { "value": "wide", "label": "Wide" }] },
{ "id": "tone", "type": "enum", "role": "style", "label": "Tone", "description": "Surface family: paper is the white card for light frames, ink inverts it for dark frames.", "default": "paper", "options": [{ "value": "paper", "label": "Paper" }, { "value": "ink", "label": "Ink" }] },
{ "id": "reveal", "type": "enum", "role": "motion", "label": "Reveal", "description": "Whether the body fades in with the height. fade is the shipped motion, solid opens the height only.", "default": "fade", "options": [{ "value": "fade", "label": "Fade" }, { "value": "solid", "label": "Solid" }] }
]'
>
<header>Motion tokens</header>
<div>
<p>Duration 420ms</p>
<p>Easing power3.out</p>
</div>
</section>
<style>
.hf-transition-panel-reveal {
--hf-panel-open: 1;
width: var(--hf-panel-width, 360px);
overflow: hidden;
border: 1px solid var(--hf-panel-border, #e4e4e7);
border-radius: 14px;
background: var(--hf-panel-surface, #fff);
color: var(--hf-panel-text, #18181b);
font-family: Inter, system-ui, sans-serif;
box-shadow: 0 20px 56px rgba(24, 24, 27, 0.1);
}
.hf-transition-panel-reveal header {
padding: 15px 17px;
font-weight: 900;
}
.hf-transition-panel-reveal div {
max-height: calc(var(--hf-panel-open) * 120px);
opacity: calc(1 - var(--hf-panel-fade, 1) * (1 - var(--hf-panel-open)));
padding: 0 17px calc(var(--hf-panel-open) * 17px);
overflow: hidden;
}
.hf-transition-panel-reveal p {
margin: 0 0 8px;
color: var(--hf-panel-muted, #71717a);
font-size: 14px;
}
</style>
<script>
(function () {
"use strict";
var vars =
window.__hyperframes && window.__hyperframes.getVariables
? window.__hyperframes.getVariables()
: {};
// Unrecognised overrides return to their declared defaults.
var widths = { narrow: "280px", standard: "360px", wide: "480px" };
var tones = {
paper: {
surface: "#fff",
border: "#e4e4e7",
text: "#18181b",
muted: "#71717a",
},
ink: {
surface: "#18181b",
border: "#3f3f46",
text: "#fafafa",
muted: "#a1a1aa",
},
};
var reveals = { fade: 1, solid: 0 };
function pick(table, value, fallback) {
return Object.prototype.hasOwnProperty.call(table, value) ? value : fallback;
}
var width = widths[pick(widths, vars.width, "standard")];
var tone = tones[pick(tones, vars.tone, "paper")];
var fade = reveals[pick(reveals, vars.reveal, "fade")];
var title = typeof vars.title === "string" ? vars.title.trim() : "";
if (!title) {
title = "Motion tokens";
}
var roots = document.querySelectorAll(".hf-transition-panel-reveal");
for (var i = 0; i < roots.length; i += 1) {
var root = roots[i];
root.style.setProperty("--hf-panel-width", width);
root.style.setProperty("--hf-panel-surface", tone.surface);
root.style.setProperty("--hf-panel-border", tone.border);
root.style.setProperty("--hf-panel-text", tone.text);
root.style.setProperty("--hf-panel-muted", tone.muted);
root.style.setProperty("--hf-panel-fade", String(fade));
var header = root.querySelector("header");
if (header) {
header.textContent = title;
}
}
})();
</script>
<!--
Timeline integration:
tl.fromTo('.hf-transition-panel-reveal', { '--hf-panel-open': 0 }, { '--hf-panel-open': 1, duration: 0.44, ease: 'power3.inOut' }, startTime);
-->
```
</CatalogSlot>
<CatalogSlot slot="install">
<InstallCommand command="npx hyperframes add panel-reveal" item="panel-reveal" />
That writes one file: `compositions/components/panel-reveal.html`.
</CatalogSlot>
</CatalogDetail>
<div data-static-slot="docs" className="prose prose-gray dark:prose-invert">
## Paste it into your composition
Open `compositions/components/panel-reveal.html` and copy what is inside into your own composition.
The file opens with a comment header that walks you through it.
A component has no size or duration of its own. It takes both from the composition
you paste it into.
## Variables
Every one of these has a default, so the piece works untouched. Set the ones you
want to change on the element:
| Variable | Default | Accepts | What it does |
| --- | --- | --- | --- |
| `title` | `Motion tokens` | string | The header line that sits above the folded body. |
| `width` | `standard` | `narrow`, `standard`, `wide` | How wide the panel sits, 280, 360 or 480 px. |
| `tone` | `paper` | `paper`, `ink` | Surface family: paper is the white card for light frames, ink inverts it for dark frames. |
| `reveal` | `fade` | `fade`, `solid` | Whether the body fades in with the height. fade is the shipped motion, solid opens the height only. |
Set them with `data-variable-values` on the element that mounts it. These are the
defaults, so this behaves exactly like the preview above until you change one:
```html wrap
<div
data-composition-id="panel-reveal"
data-composition-src="compositions/components/panel-reveal.html"
data-variable-values='{"title":"Motion tokens","width":"standard","tone":"paper","reveal":"fade"}'
></div>
```
{/* hf:generated-footer */}
Tagged `transition-primitive` `transitions-dev-port` `panel` `reveal`.
## Related topics
- [Browse the complete Catalog](/catalog)
- [Add assets and Catalog items in the browser editor](/studio/assets-and-blocks)
- [Put blocks together into one video](/concepts/compositions)
</div>