Skip to content
中文

Entrance motionMotion

Three entrance motions for overlays, one for each kind of overlay. Tap “Replay” to watch them again.

Demo

展卷

定

删除这条札记

删除后无法恢复。

浮起

已保存

卷帘

点灯

晨间札记

窗外起了薄雾。

Unroll

Settle

Delete this note

This can’t be undone.

Rise

Saved

Blind

Lighting

Morning note

Fog outside the window.

Usage

ClassNameLookFor
hao-sheet--enterUnrollingSpreads upward from the bottom edge, like a scroll opening from below; the content inside fades in a moment laterSheets
hao-dialog--enterSettlingFades in place, scaling up from 96% to fullDialogs
hao-menu--enterBlindLike a bamboo blind let down: it opens from the edge that touches the button, and the items fade in a moment later. When the menu flips above its button, add hao-menu--up and it rolls upwardMenus
hao-lamp--litLightingThe lamp body lights and the whole lamp sways twice before it restsThe bookmark, at the moment of saving
hao-toast--enterRisingFloats up from 12px below and fades inToasts, bubble tips
hao-scrim--enterFade inThe scrim fades inThe scrim behind sheets and dialogs
  • Unrolling is this system’s own entrance: a sheet doesn’t slide up as one block; it spreads upward where it is. It runs 320ms, fast at the start and easing to a stop.
  • The entrance adds these classes to the overlay; the exit plays in reverse, at two-thirds of the duration.
  • Only one overlay moves at a time. The scrim and the overlay start together.
  • The stamp is another motion, reserved for the moment of completion; see Stamp.
  • When Reduce Motion is on, all entrances are dropped and overlays simply appear.
  • Don’t add entrance motion to ordinary page content: cards, lists, and headings are just there.
  • Like the stamp, the lighting plays once, at the moment the person acts; a lamp already lit when the page opens stays still.

Accessibility

  • The entrance motion carries no information: an overlay’s appearing and disappearing are decided by the hidden attribute, and with the motion off, the content still lands in place.
  • Reduce Motion is handled once, in the stylesheet; you don’t need to check it again in your own code.
  • A toast must announce itself: in the preview it carries role="status"; with the behavior script loaded, a real toast goes into an aria-live polite region and doesn’t steal focus.