Microinteractions

A collection of UI microinteractions with live demos, timing notes, and copyable HTML, CSS, JavaScript, and Tailwind code. React components install with shadcn. The site is open source on GitHub.

Skill for coding agents

npx skills@latest add https://microinteractions.dev

Actions

  1. Swap labels without changing the button width.

    Trigger
    Hover, focus, tap
    Duration
    220ms / 160ms out
    Easing
    ease-out-quint
    Open study
  2. Confirm this action?

    Hold the button for 1,200ms to confirm. Release early to cancel.

    Trigger
    Press and hold
    Duration
    1200ms / 180ms out + 160ms confirmation
    Easing
    linear
    Open study

Navigation

  1. Extend a chevron into an arrow on hover.

    Trigger
    Hover, focus, tap
    Duration
    190ms
    Easing
    ease-out-expo
    Open study
  2. Pluck a link underline like a string tuned by its length.

    Trigger
    Hover, tap
    Duration
    400–1200ms / 110ms out
    Easing
    linear() · damped
    Open study
    • Text swap button
    • Hold to confirm button
    • Copy to clipboard

    2 more

    Slide the underline to the chosen tab without moving the labels.

    Trigger
    Click, tap, arrow keys
    Duration
    250ms
    Easing
    ease-out-quint
    Open study
  3. 01
    02
    03
    04
    05
    06

    Drag along the dots to scrub the slides, with a worm that follows the scroll.

    Trigger
    Drag, swipe, tap, arrow keys
    Response
    80–360ms · direct
    Indicator
    Follows the scroll
    Open study
  4. Overview

    A rail of short ticks, one per section. The ticks grow around the pointer, and a card previews the section under it.

    Install

    Copy the markup, styles, and script, or install the React port with the shadcn CLI.

    Usage

    Give every section an id and the rail one link per section. The links work as plain anchors before the script runs.

    Theming

    Set the colors of the ticks, the lit tick, and the current section on the component or any ancestor.

    Keyboard

    Tab reaches each tick. Up and Down move between them, Home and End jump, and Escape hides the card.

    Touch

    A finger can't hover, so the first tap shows the card and a second tap on the same tick follows the link.

    Reduced motion

    The ticks change length at once, and the card appears, moves, and changes its text without animating.

    Browser support

    Current Chrome, Edge, Firefox, and Safari. Without JavaScript, the ticks are ordinary links.

    Tick rail

    , new

    Grow the ticks around the pointer and preview the section under it.

    Trigger
    Hover, focus, tap
    Duration
    120–200ms
    Falloff
    Cosine over 3 rows
    Open study

Toggles & choices

  1. Delivery

    Pour the selection from one option to the next.

    Trigger
    Click, tap, arrow keys
    Duration
    340ms
    Easing
    ease-in-out-cubic
    Open study
    • Time zone
      Auckland
      Bangkok
      Berlin
      Buenos Aires
      Cairo
      Chicago
      Dubai
      Helsinki
      Hong Kong
      Istanbul
      Johannesburg
      Lagos
      Lima
      Lisbon
      London
      Los Angeles
      Madrid
      Mexico City
      Mumbai
      New York
      Paris
      São Paulo
      Seoul
      Sydney
      Tokyo
      Toronto
    • Notifications
      Off
      Allow
    • Send message with
      ⌘+Enter
      Enter
    • Appearance
      System
      Light
      Dark

    Open the menu with the current option on top of the trigger.

    Trigger
    Press and drag, click, keys
    Duration
    70ms
    Release guard
    10px
    Open study

Values

  1. Keep a slider's value label inside its container.

    Trigger
    Drag, tap, arrow keys
    Response
    0ms · direct
    Easing
    linear · 1:1
    Open study

Disclosure

  1. Yes, under MIT. Copy the CSS or Tailwind version, or install the React port. Credit is welcome, not required.

    Slide one panel to the question you open and fit it to the answer.

    Trigger
    Click, tap, Enter
    Duration
    140–300ms
    Text
    Moves with the panel
    Open study

Direct manipulation

  1. Planned studies

    0 of 10

    Study Category
    Copy to clipboard Actions
    Tab indicator Navigation
    Switch Toggles & choices
    Segmented control Toggles & choices
    Number scrub Values
    One-time code Input
    Popover Disclosure
    Toast Feedback
    Undo Feedback
    Drag to reorder Direct manipulation
    Each box toggles its row, and so does a click anywhere on the row. Drag down the box column to give a run of rows the first row's new state, or Shift+click to extend from the last row you changed. With focus on a box, Shift+Up and Shift+Down give that box's state to the rows you move onto, and moving back restores them. Escape cancels a drag.

    Check a run of table rows in one drag down the boxes.

    Trigger
    Drag, click, Shift+arrows
    Duration
    90–160ms
    Selection
    Range from the first row
    Open study
  2. Studies

    • Text swap button
    • Hold to confirm button
    • Edge-aware tooltip
    • Drag to select
    • Gooey radio group
    • Plucked underline

    Direct manipulation

    Drag to select

    Check a run of table rows in one drag down the boxes.

    Show the grip where the pointer meets the divider.

    Trigger
    Drag, arrow keys, Enter
    Response
    100–240ms · direct
    Grip
    Follows the pointer
    Open study

    Press Space to pick up, the arrow keys to move, Space to drop, Escape to cancel.

    Open a gap in a list that follows the item you drag.

    Trigger
    Drag, Space, arrow keys
    Response
    250ms · direct
    Nudge
    8px × 0.7ⁿ
    Open study