Page Site Header

网站页头:徽标、导航和操作,窄屏时由菜单按钮在 Sheet 面板中打开导航,置于可吸顶的 header 中。

可用框架
  • Angular: 可用
  • Vue: 可用
  • React: 可用
  • React Native: 暂不可用

用法

导入

ts
import {
  SonePageSiteHeaderActionsDirective,
  SonePageSiteHeaderComponent,
  SonePageSiteHeaderLogoDirective,
  SonePageSiteHeaderMenuDirective,
  SonePageSiteHeaderNavDirective,
} from "@surface-one/angular/page-site-header";

API 参考

SonePageSiteHeaderActionsDirective指令

`[sonePageSiteHeaderActions]` — controls at the end: a theme switch, a sign-in button.

选择器
[sonePageSiteHeaderActions]

SonePageSiteHeaderComponent组件

`<sone-page-site-header>` — the header of a site (Nuxt UI Header): the logo or a `title` link, the `[sonePageSiteHeaderNav]` navigation (a `sone-navigation-menu`, a list of links) and `[sonePageSiteHeaderActions]`. Below a medium width (a container query) the navigation gives way to a menu button that opens `[sonePageSiteHeaderMenu]` in a sheet — focus trapped, Escape and the scrim close it, a link in it closes it too; `[(open)]` is that sheet. It renders a `<header>`, the page's banner outside `main`; `sticky` pins it to the top.

选择器
sone-page-site-header
输入
名称类型 默认值
title

A text logo, a link to `href` (use `[sonePageSiteHeaderLogo]` for your own).

string | nullnull
hrefstring"/"
open双向

The narrow-screen menu sheet — `[(open)]`.

booleanfalse
sticky

Pins the header to the top of the scrolling page.

booleanfalse
menuLabel

Names the menu button and the sheet it opens.

—$localize`:Opens a site's navigation menu:Menu`

SonePageSiteHeaderLogoDirective指令

`[sonePageSiteHeaderLogo]` — the logo at the start of the header.

选择器
[sonePageSiteHeaderLogo]

SonePageSiteHeaderMenuDirective指令

`[sonePageSiteHeaderMenu]` — the narrow-screen menu, shown in a sheet by the menu button.

选择器
[sonePageSiteHeaderMenu]

SonePageSiteHeaderNavDirective指令

`[sonePageSiteHeaderNav]` — the site navigation, shown once the header is wide enough.

选择器
[sonePageSiteHeaderNav]