Page Site Header
Nagłówek witryny: logo, nawigacja i akcje oraz przycisk menu, który na wąskich ekranach otwiera nawigację w panelu Sheet, w elemencie header, który może przylegać do góry.
Angular: dostępny Vue: dostępny React: dostępny React Native: jeszcze niedostępny
Użycie
<sone-page-site-header title="Acme Notes" href="#" [(open)]="menuOpen">
<nav sonePageSiteHeaderNav aria-label="Demo site" class="cluster" data-gap="4">
<a href="#features">Features</a>
<a href="#pricing">Pricing</a>
<a href="#blog">Blog</a>
</nav>
<a sonePageSiteHeaderActions soneBtn size="sm" href="#start">Get started</a>
<nav sonePageSiteHeaderMenu aria-label="Demo site menu" class="stack">
<a href="#features">Features</a>
<a href="#pricing">Pricing</a>
<a href="#blog">Blog</a>
</nav>
</sone-page-site-header>Import
import {
SonePageSiteHeaderActionsDirective,
SonePageSiteHeaderComponent,
SonePageSiteHeaderLogoDirective,
SonePageSiteHeaderMenuDirective,
SonePageSiteHeaderNavDirective,
} from "@surface-one/angular/page-site-header";Dokumentacja API
SonePageSiteHeaderActionsDirectiveDyrektywa
`[sonePageSiteHeaderActions]` — controls at the end: a theme switch, a sign-in button.
SonePageSiteHeaderComponentKomponent
`<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.
| Nazwa | Typ | Domyślnie |
|---|---|---|
titleA text logo, a link to `href` (use `[sonePageSiteHeaderLogo]` for your own). | string | null | null |
href | string | "/" |
opendwukierunkoweThe narrow-screen menu sheet — `[(open)]`. | boolean | false |
stickyPins the header to the top of the scrolling page. | boolean | false |
menuLabelNames the menu button and the sheet it opens. | — | $localize`:Opens a site's navigation menu:Menu` |
SonePageSiteHeaderLogoDirectiveDyrektywa
`[sonePageSiteHeaderLogo]` — the logo at the start of the header.
SonePageSiteHeaderMenuDirectiveDyrektywa
`[sonePageSiteHeaderMenu]` — the narrow-screen menu, shown in a sheet by the menu button.
SonePageSiteHeaderNavDirectiveDyrektywa
`[sonePageSiteHeaderNav]` — the site navigation, shown once the header is wide enough.