一套 React 微交互组件,专注于点击后的半秒关键期,提供无样式的行为 Hook 和带样式的示例。

Stars

77

7 天增长

暂无数据

Fork 数

1

开放 Issue

0

开源协议

MIT

最近更新

2026-07-30

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它专门解决了常被忽略的 20% 交互细节——抖动、重启动画以及忽略用户的动画,并提供了健壮、可访问的实现,支持 prefers-reduced-motion 和纯键盘操作。

适合谁使用

  • 构建精致 UI 的 React 开发者
  • 专注于微交互的 UI/UX 工程师
  • 注重无障碍的开发者
  • 希望打造可信赖、响应式界面的产品团队

典型使用场景

  • 为按钮添加平滑过渡,避免布局偏移
  • 实现列表加载动画,防止跳动
  • 实现拖拽交互,避免标签页失焦后卡住
  • 增强任何在点击后需要建立用户信任的 UI 元素

项目优势

  • 无样式 Hook 将行为与样式分离,便于重新设计
  • 每个交互都经过逐帧推敲,采用物理运动建模
  • 完整键盘支持并尊重 prefers-reduced-motion
  • 无包依赖——每个组件都是可复制的单个文件

使用前须知

  • 无 npm 包,需手动复制到项目中
  • 唯一依赖 motion.dev,可能不适用所有技术栈
  • 初始组件数量有限(示例提及按钮、列表、拖拽)

README 快速开始

interior[.]dev

Micro-interactions for React, built for the half-second after a click.

Everybody builds these components. Almost nobody finishes them. The missing twenty percent is always the same three things: a jump, a restart, an animation that ignores the person watching it. This set ships that last twenty percent.

How it works

There is no package. Every component is one file in components/interior/ that you copy into your project. Each file exports two things:

  • a headless hook (useX) that owns all the behaviour and touches zero class names
  • a styled component (X) built on the hook, as an example you can keep or replace

The behaviour lives entirely in the hook, so reskinning a component to your own design language costs nothing but classes. The only dependency is motion.

The idea

Trust is won in the half-second after a click, and lost in exactly the same place. A button that resizes when its label changes, a list that jumps as it loads, a drag that gets stuck because the tab lost focus: none of these are bugs anyone files, but every one of them teaches the person to stop believing the interface.

So every component here is argued out to the frame. Nothing moves unless something happened; motion that models a physical process obeys that process instead of taste; every state the component can reach has its space reserved before it arrives; and every gesture knows all the ways it can be abandoned. The keyboard is not a fallback but a second complete implementation, and under prefers-reduced-motion the information still arrives; only the trip is skipped.

Running the docs

bun install
bun run dev

The design language behind every decision lives in DESIGN.md.

项目描述

micro-interactions for react, built for the half-second after a click

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

NUber-dev
精选
NUber-dev GitHub avatar

YTubic

YTubic is a fast, responsive, open-source YouTube Music desktop client for Windows, Linux, and macOS that uses direct InnerTube API communication and aggressive caching to provide instant navigation and playback.

Web 开发前端框架
226
react
精选
react GitHub avatar

react

React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.

Web 开发前端框架
246,741
TanStack
精选
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web 开发前端框架
14,861