--- title: "Pendulum Swing" description: "Content hangs from a fixed pivot and swings into rest with gravity-damped oscillation, like a hanging sign settling on its hook." mode: "frame" --- import { CatalogDetail, CatalogSlot } from "/snippets/catalog-detail.jsx"; import { InstallCommand } from "/snippets/install-command.jsx"; ```html pendulum-swing.html
Hanging Sign
```
That writes one file: `compositions/components/pendulum-swing.html`. ## Paste it into your composition Open `compositions/components/pendulum-swing.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 | | --- | --- | --- | --- | | `pivot` | `top-center` | `top-center`, `top-left`, `top-right` | Where the content hangs from. The swing rotates about this point, so the top edge stays pinned. | | `amplitude` | `standard` | `gentle`, `standard`, `wide` | How far the first swing reaches before it settles. Every later swing scales with it, so the pendulum still comes to rest upright. | | `direction` | `right` | `right`, `left` | Which side the pendulum swings in from: right lifts the first swing clockwise, left mirrors it. | | `tone` | `ink` | `ink`, `paper`, `accent` | Content colour: ink for light frames, paper for dark ones, accent rides --brand. | 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
``` {/* hf:generated-footer */} Tagged `motion-primitive` `physics` `swing` `settle` `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)