Skip to content

Accessibility and diagnostics

Motion is not free for everyone who sees it. For some people a page that slides, parallaxes and springs is nausea, not delight - which is why browsers ship prefers-reduced-motion. Bmotion honours it, but not by throwing every animation away: opacity and colour keep animating while transforms, layout and dimension changes snap. That is the difference between a page that stops moving and a page that stops working.

Reduced motion, four ways

Pick the policy once, at registration. User is the recommended setting and the web-platform default: follow the operating system everywhere. The default is IgnoreUnlessConfigured, which only consults the OS inside a <BmotionConfig> - a back-compatible choice, so an app that never opted in can never have its animations silently switched off underneath it.

BmotionReducedMotionModeBehaviour
IgnoreUnlessConfigured The default, for back-compatibility. The OS preference is respected only inside a <BmotionConfig>.
User Recommended. Respect the OS preference everywhere - the web-platform default.
Always Always reduce, whatever the OS says. Useful for a per-app 'reduce motion' setting.
Never Never reduce. For surfaces where the motion carries the meaning.

What "reduced" actually does

Both boxes below animate x, rotate and backgroundColor. The right one sits inside <BmotionConfig ReduceMotion="true">: its position and rotation jump straight to the target while its colour still crossfades. Nothing is lost - the state change is still legible, it just does not travel across the screen.

Normal
ReduceMotion="true"

Per element: reduce, instant or in full

Whether motion is reduced is the user's and the app's decision; how an element answers it is the element's. ReducedMotion (or a preset's ReducedMotion) picks one of three answers. All three boxes below sit inside <BmotionConfig ReduceMotion="true"> and fade while sliding: Reduce - the default - lands the slide and keeps the fade; Instant lands both (decorative motion that adds nothing once calm); Full keeps the whole animation, for motion that carries information - a progress bar, a counter - and is calm already. Use Full sparingly: never for motion that travels far, zooms or spins.

ReducedMotion="Reduce"
ReducedMotion="Instant"
ReducedMotion="Full"

Slowing everything down

TransitionSpeed is a playback multiplier over a whole subtree, and it scales every time-based field - duration, delay, repeat delay, a spring's visual duration - so the animation stays in proportion rather than having its delays left behind. It is how you review timing at quarter speed without editing a single transition, and TransitionSpeed="0" is how you check what a page looks like with no motion at all.

TransitionSpeed: 1
TransitionSpeed: 0.35
TransitionSpeed: 0.1

Keyboard-accessible taps

WhileTap is not a mouse-only state. When a tappable element has focus, Enter and Space press and release it exactly like a pointer - WhileTap plays and OnTap fires, and losing focus mid-press cancels it the way dragging off the element does. Give the element tabindex="0" if it is not natively focusable. Tab to the box below and press Space.

Tab to it, then press Enter or Space
0

Knowing what the runtime can do

Rather than guessing which render mode you are in, inject BmotionCapabilities. On Blazor Server there is no synchronous interop, so the per-frame loop cannot run. The browser still plays almost everything there: transforms, opacity, colours, sizes, filters, keyframes, springs, inertia and arcs all animate. What only the loop can play, per-frame callbacks and SVG path morphs, lands on its target at once. Drag works, but follows the pointer a round trip behind, so immediate pointer response needs WebAssembly. Detect it and offer a different affordance instead of shipping a control that does not feel the way you meant. SupportsCompositor is true everywhere - the browser's Web Animations API is what plays most animations on both runtimes. IsPrerendering is true during the server's prerender pass, when nothing animates and the other two describe the server rather than the runtime that takes over - so check it first. (This page is prerendered too: the badges below were briefly the server's before WebAssembly took over.)

This runtime
IsPrerendering: True SupportsFrameLoop: False SupportsCompositor: True

Watching the engine

OnUpdate hands you the exact CSS the engine flushed to an element this frame. It is a plain delegate rather than an EventCallback on purpose: it runs inside the render loop, so it must not trigger a re-render per frame - read it, and update the DOM yourself or throttle to state.

Live transform, straight from the frame callback

For everything at once there is <BmotionInspector />: drop it anywhere in a development build and it lists every element registered with the engine, its active drivers and its live values. It is the answer to "is this element animating, and what does the engine think its transform is?" - a question that is otherwise very hard to ask from the outside. RefreshMs sets how often it polls the engine (200 ms by default) and StartOpen="false" starts it collapsed to its title bar.

Bmotion 0 el · 0 active ▸
An unhandled error has occurred. Reload 🗙