Skip to main content

Animate appearance

Animate one appearance channel at a time.

Before you start: Choose what transitions.

Colors, opacity, radius, border width, and shadow can follow springs or tweens. Keep the property selector explicit while learning.

Transition color​

transition-colors selects foreground, background, and border colors.

<Column state="{changed:false}" class="p-4 gap-3">
<View bind-class="'w-16 h-16 transition-colors ' + (changed ? 'bg-danger' : 'bg-accent')" />
<Button title="Change target" on-press="toggle changed" />
</Column>
Transition color
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: Change bg-danger to bg-success.

Transition radius​

transition-radius animates the resolved corner radius.

<Column state="{changed:false}" class="p-4 gap-3">
<View bind-class="'w-16 h-16 bg-accent transition-radius ' + (changed ? 'rounded-full' : 'rounded-none')" />
<Button title="Change target" on-press="toggle changed" />
</Column>
Transition radius
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: Replace rounded-full with rounded-xl.

Transition border​

transition-border includes border color and drawn width.

<Column state="{changed:false}" class="p-4 gap-3">
<View bind-class="'w-16 h-16 border-border transition-border ' + (changed ? 'border-2' : 'border-0')" />
<Button title="Change target" on-press="toggle changed" />
</Column>
Transition border
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 switching border-0 and border-2 with another border color.

Transition shadow​

transition-shadow changes portable shadow strength. Native shadow shapes can differ.

<Column state="{changed:false}" class="p-4 gap-3">
<View bind-class="'w-16 h-16 bg-card transition-shadow ' + (changed ? 'shadow-sm' : 'shadow-none')" />
<Button title="Change target" on-press="toggle changed" />
</Column>
Transition shadow
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: Add spring-soft to make the response easier to observe.

Next: transforms. Reference: transition selectors.