ProgressBar
A bar that fills from the left to its value.
tsx
import { Clip, Composition, ProgressBar, Track } from "@cutcraft/kit";
// ProgressBar: a bar that fills from the left to its value.
export default function Video() {
return (
<Composition fps={30} width={1920} height={1080}>
<Track id="main">
<Clip id="shot" src="asset:coffeeWide" in={4} out={7} fit="cover" />
</Track>
<Track id="over" layout="free">
<ProgressBar id="brew" start={0.3} duration={2.7} value={0.7} fillFor={1.8} />
</Track>
</Composition>
);
}The coffee footage is Pixabay videos 209419 and 209424, under the Pixabay Content License.
Props
Besides the timing props (start, anchor, at, offset, duration):
| param | type | default | description |
|---|---|---|---|
id | string | The component's id; each of its parts' ids starts with it. | |
value | number (0..1) | 1 | How full it ends, 0 to 1. |
x | number | 0 | The bar's centre, in pixels from the frame's centre. |
y | number | 440 | The bar's centre, in pixels below the frame's centre. |
width | number (> 0) | 1200 | The full bar's length in pixels. |
height | number (> 0) | 14 | The bar's thickness in pixels; its ends are rounded. |
color | string | "$primary" | The fill's colour; the track under it is a faint $muted. |
fillFor | number (> 0) | 1.2 | Seconds it takes to fill. |