--- title: Data Attributes description: "Core attributes for controlling element timing and behavior." --- Hyperframes uses HTML data attributes to control timing, media playback, and [composition](/concepts/compositions) structure. These are the declarative building blocks of every video. ## Timing Attributes | Attribute | Example | Description | |-----------|---------|-------------| | `data-start` | `"0"` or `"intro"` | Start time in seconds, or a clip ID reference for [relative timing](#relative-timing) | | `data-duration` | `"5"` | Duration in seconds. Required for images. Optional for video/audio (defaults to source duration). Not used on compositions. | | `data-track-index` | `"0"` | Timeline track number. Controls z-ordering (higher = in front) and groups clips into rows. Clips on the same track cannot overlap. | ## Media Attributes | Attribute | Example | Description | |-----------|---------|-------------| | `data-media-start` | `"2"` | Media playback offset / trim point in seconds. Default: `0` | | `data-volume` | `"0.8"` | Audio/video volume, 0 to 1 | | `data-has-audio` | `"true"` | Indicates video has an audio track | ## Composition Attributes | Attribute | Example | Description | |-----------|---------|-------------| | `data-composition-id` | `"root"` | Unique ID for [composition](/concepts/compositions) wrapper (required on every composition) | | `data-width` | `"1920"` | Composition width in pixels | | `data-height` | `"1080"` | Composition height in pixels | | `data-composition-src` | `"./intro.html"` | Path to external [composition](/concepts/compositions) HTML file | | `data-variable-values` | `'{"title":"Hello"}'` | JSON object of values passed to a nested composition. HyperFrames carries these values through, but your composition script must read and apply them manually. | ## Element Visibility Add `class="clip"` to all timed elements so the runtime can manage their visibility lifecycle: ```html index.html