交互性
用于控制鼠标悬停在元素上时光标样式的实用工具。
类名 | 样式 |
---|---|
cursor-auto | cursor: auto; |
cursor-default | cursor: default; |
cursor-pointer | cursor: pointer; |
cursor-wait | cursor: wait; |
cursor-text | cursor: text; |
cursor-move | cursor: move; |
cursor-help | cursor: help; |
cursor-not-allowed | cursor: not-allowed; |
cursor-none | cursor: none; |
cursor-context-menu | cursor: context-menu; |
cursor-progress | cursor: progress; |
cursor-cell | cursor: cell; |
cursor-crosshair | cursor: crosshair; |
cursor-vertical-text | cursor: vertical-text; |
cursor-alias | cursor: alias; |
cursor-copy | cursor: copy; |
cursor-no-drop | cursor: no-drop; |
cursor-grab | cursor: grab; |
cursor-grabbing | cursor: grabbing; |
cursor-all-scroll | cursor: all-scroll; |
cursor-col-resize | cursor: col-resize; |
cursor-row-resize | cursor: row-resize; |
cursor-n-resize | cursor: n-resize; |
cursor-e-resize | cursor: e-resize; |
cursor-s-resize | cursor: s-resize; |
cursor-w-resize | cursor: w-resize; |
cursor-ne-resize | cursor: ne-resize; |
cursor-nw-resize | cursor: nw-resize; |
cursor-se-resize | cursor: se-resize; |
cursor-sw-resize | cursor: sw-resize; |
cursor-ew-resize | cursor: ew-resize; |
cursor-ns-resize | cursor: ns-resize; |
cursor-nesw-resize | cursor: nesw-resize; |
cursor-nwse-resize | cursor: nwse-resize; |
cursor-zoom-in | cursor: zoom-in; |
cursor-zoom-out | cursor: zoom-out; |
cursor-(<custom-property>) | cursor: var(<custom-property>); |
cursor-[<value>] | cursor: <value>; |
使用类似 cursor-pointer
和 cursor-grab
这样的实用工具来控制鼠标悬停在元素上时显示的光标样式
悬停在每个按钮上以查看光标变化
<button class="cursor-pointer ...">Submit</button><button class="cursor-progress ...">Saving...</button><button class="cursor-not-allowed ..." disabled>Confirm</button>
使用 光标-[<value>]
语法 来设置光标基于完全自定义的值
<button class="cursor-[url(hand.cur),_pointer] ..."> <!-- ... --></button>
对于 CSS 变量,你也可以使用 光标-(<custom-property>)
语法
<button class="cursor-(--my-cursor) ..."> <!-- ... --></button>
这只是 光标-[var(<custom-property>)]
的简写形式,会自动为你添加 var()
函数。
前缀一个 cursor
实用工具 带有像 md:
这样的断点变体,以便仅在medium 屏幕尺寸及以上应用该实用工具
<button class="cursor-not-allowed md:cursor-auto ..."> <!-- ... --></button>
在 变体文档 中了解更多关于使用变体的信息。