Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 02 Foundations

Motion

Motion shows where something came from. Nothing over 400ms, nothing with reduced motion on.

Tokens

Three durations and one curve, quick to start and soft to land.

TokenValueTailwindFor
--ui-duration-fast150msduration-fastA change in place: the switch knob.
--ui-duration250msduration-uiFades: dialog, backdrop, accordion arrow.
--ui-duration-slow400msduration-slowPanels that travel: drawer, sheet, toast.
--ui-easecubic-bezier(0.2, 0.8, 0.2, 1)ease-uiEvery transition. Loading loops run linear at their own speed.

Try the durations

Pick a token, then press Play: all three move at that speed.

--ui-duration · 250ms

Switch, panel and fade

Fades: dialog, backdrop, accordion arrow.

Angular
<div class="translate-x-0 transition-transform duration-ui ease-ui motion-reduce:transition-none">
  Panel
</div>

Animations

Ready-made entrances and feedback. Add the class when the element appears; press Replay to see each one again.

Okaapi
ui-anim-fade-inContent that appears in place.
Okaapi
ui-anim-slide-upMenus, cards and list items entering.
Okaapi
ui-anim-slide-downBanners and dropdowns from above.
Okaapi
ui-anim-slide-startSide panels; flips in right-to-left.
Okaapi
ui-anim-scale-inPopovers and tooltips.
Okaapi
ui-anim-popConfirm a change: a badge count, a saved tick.
Okaapi
ui-anim-shakeAn invalid field or a refused action.
ui-anim-staggerChildren enter one after another (up to 8).
ui-anim-pingA live or new indicator; loops.
Okaapi
ui-anim-shimmerA loading sweep over a placeholder; loops.

All of them stop under reduced motion. Loops (ping, shimmer) are for waiting, never decoration.

Rules

  • Animate opacity, transform and colour; never size or position.
  • Reduced motion stops everything; the spinner holds still.
  • Closing never waits for an animation.