何时适合
适合在默认值附近小幅调整(Zhou, 2018;Apple, n.d.),范围大则需点几十次。
直接输入与范围
允许点击数字输入,设置min、max、step(MDN, n.d.),上下限时变灰,用行内校验提示超库存。
尺寸与无障碍
小而相邻的按钮易误点(菲茨定律;Parhi et al., 2006),遵守触控目标,遵循spinbutton(W3C, n.d.)与4.1.3(WCAG 2.2)。
常见问题
- 步进器还是下拉?
- 小幅递增用步进器,固定值用下拉。
- 只用type=number行吗?
- 原生箭头太小,宜配大按钮。
来源核查日期:2026-10-27
参考文献
- Zhou, Y. (2018, November 11). Design guidelines for input steppers. Nielsen Norman Group. 步进器的适用场景。
- Apple. (n.d.). Steppers. Human Interface Guidelines. iOS步进器指南。
- MDN Web Docs. (n.d.). <input type="number">. Mozilla. min、max、step属性。
- World Wide Web Consortium. (n.d.). Spinbutton pattern. ARIA Authoring Practices Guide. spinbutton角色。
- Fitts, P. M. (1954). The information capacity of the human motor system in controlling the amplitude of movement. Journal of Experimental Psychology, 47(6), 381–391. 小按钮难点中。
- Parhi, P., Karlson, A. K., & Bederson, B. B. (2006). Target size study for one-handed thumb use on small touchscreen devices. In Proceedings of MobileHCI 2006 (pp. 203–210). ACM. 按钮尺寸与间距。
- World Wide Web Consortium. (2023). Web Content Accessibility Guidelines (WCAG) 2.2. 2.5.8与4.1.3标准。
