Skip to main content

Use fixed timing

Choose a fixed-duration response for an opacity transition.

Before you start: Choose what transitions.

Add tween to select duration/easing timing. The default tween is 150 ms with ease-in-out. duration-300 makes it 300 ms. ease-out changes its curve; delay-100 waits 100 ms before starting.

Fixed transition timing​

Duration and easing require an effective tween. They are validation errors on an effective spring.

<Column state="{changed:false}" class="p-4 gap-3">
<View bind-class="'w-16 h-16 bg-accent transition-opacity tween duration-300 ease-out ' + (changed ? 'opacity-25' : 'opacity-100')" />
<Button title="Change target" on-press="toggle changed" />
</Column>
Fixed transition timing
editable
Browser preview
rReady to explore
Environment & events

Browser rendering of the shared document. Host services are bundled demo mocks. XML edits reset local state; data edits preserve compatible state.

Interact with the preview to inspect emitted events and mocked service calls.

Try it: Try durations 150 and 600, then add delay-100. Change one setting at a time.

For motion that preserves momentum, learn springs. Reference: tween, duration, easing, delay.