跳至正文

Header

原生网站页头,可选配滚动增强功能。

浏览器
Chrome 123+Firefox 121+Safari 17.5+
层级
0
压缩后大小
141 B
强制布局预算
0 ms
axe 预算
0
支持 SSR
是
公开契约
测试环境

交互示例

Orbit

Orbit

Team workspace

Keep your team's projects and recent updates in one place.

Docs

Find guides for organizing projects and collaborating with your team.

Projects

Start a new project and plan your next milestone.

Scroll inside the panel. Enable Hide on scroll to hide down and reveal up.

Team workspace

A shared view of what you are working on.

12Active projects
4Awaiting review

Workspace overview

Keep your team's projects and recent updates in one place.

Projects

Website refresh · In progress. Design library · Ready for review.

Recent activity

The team updated the roadmap and shared a new design proposal.

Create a project

Start with a name, invite your team, and plan your next milestone.

Workspace help

Find guides for organizing projects and collaborating with your team.

API

Header.Root

属性类型默认值说明
placement"static" | "sticky""static"语义化页头的原生定位方式。Sticky定位限制在最近的滚动容器内。
refRef<HTMLElement>—转发给原生header元素的ref。

HeaderClient

属性类型默认值说明
placement"static" | "sticky""sticky"Static定位禁用隐藏。原生Root默认为static。
hideOnScrollbooleantrue持续向下滚动超过Header高度后隐藏;向上滚动或到达顶部时显示。
scrollTargetstring—滚动区域元素id。省略时使用所属window。目标不存在时Header保持可见,不回退到window。
refRef<HTMLElement>—转发给同一原生header的ref;保留原生props、className、style和事件。

键盘

按键操作
Tab在链接和操作之间移动;焦点进入HeaderClient时会使其显示
Enter / Space通过触发器打开由原生机制组合而成的Modal
Escape关闭导航Modal,并将焦点返回触发器

无障碍

Header.Root渲染语义化<header>,无须客户端JavaScript;HeaderClient添加滚动时隐藏功能。两者在水合前均可见。内部获得焦点,或后代模态对话框、弹出层、展开折叠区域处于打开状态时,页头保持可见;启用减少动态效果时会移除滑动。使用带唯一id的Modal组成部分构建移动导航。为nav元素提供标签,用aria-current标记当前链接,并在片段导航前关闭对话框。

样式钩子

data-uiify-headerdata-placement="static|sticky"data-state="top|visible|hidden" (HeaderClient only)
本页由机器翻译,尚未经人工审核。