headlessui README

The project's README from github.com/tailwindlabs/headlessui. As one markdown file: README.md.

Headless UI

A set of completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.


Documentation

For full documentation, visit headlessui.com.

Installing the latest version

You can install the latest version by using:

Installing the insiders version

You can install the insiders version (which points to whatever the latest commit on the main branch is) by using:

Note: The insiders build doesn't follow semver and therefore doesn't guarantee that the APIs will be the same once they are released.

Packages

Name Version Downloads
@headlessui/react npm version npm downloads
@headlessui/vue npm version npm downloads
@headlessui/tailwindcss npm version npm downloads

Community

For help, discussion about best practices, or feature ideas:

Discuss Headless UI on GitHub

Contributing

If you're interested in contributing to Headless UI, please read our contributing docs before submitting a pull request.

headlessui (tailwindlabs/headlessui)

Searching Database…

这是什么?Headless UI 是一套完全不带样式、但无障碍支持完善的 UI 组件,专为与 Tailwind CSS 无缝搭配而设计,由 Tailwind Labs 团队开发。
它是给 React 用的、Vue 用的,还是两者都支持?两者都支持,通过不同的 npm 包提供:React 项目用 @headlessui/react,Vue 项目用 @headlessui/vue。另外还发布了第三个包 @headlessui/tailwindcss。
我怎么把它加到自己的项目里?安装对应你框架的包即可:npm install @headlessui/react@latest 或 npm install @headlessui/vue@latest。完整文档在 headlessui.com。
必须搭配 Tailwind CSS 一起用吗?这些组件就是为与 Tailwind CSS 无缝搭配而设计的。由于组件本身不带任何样式,整个外观都得由你自己来写——Tailwind 只是最顺手的搭档。
insiders 构建用在生产环境安全吗?正式发布的版本可以当作稳定版使用;insiders 构建跟随 main 分支的最新提交,不遵循语义化版本,在正式发布前它的 API 随时可能变动。
键盘操作和 ARIA 属性还得我自己处理吗?不用——无障碍支持正是它的主打特性:组件开箱即用就具备完整的无障碍能力,焦点和键盘行为都已处理妥当,你只需要负责样式。
比起现成样式齐全的 UI 组件库,选不带样式的组件有什么好处?你可以完全掌控页面结构和外观——用自己写的 Tailwind 类来设计一切样式——而无障碍行为仍由这个库替你处理。
这是个成熟的项目,还是刚起步的试验品?相当成熟:托管在 tailwindlabs 这个 GitHub 组织下,从 2020 年开始开发,目前大约有 28,800 颗星。
Size
6.9 MB
Stars
28.8K
Age
6y
Commits · 90 Days