function / @typed/ui/index

Heading.Heading

Renders a div with heading semantics and an explicit level.

Learn this UI primitive →

Package version
1.0.0-beta.7
Category
Structure and naming
Since
1.0.0
Member of
Heading

Import

import { Heading } from "@typed/ui/index";

Access Heading.Heading through the imported Heading export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export declare function Heading<const Options extends HeadingOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, HeadingInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;

Examples

import { html } from "@typed/template";
import { Heading } from "@typed/ui/Heading";

export function AccountSection(level: 2 | 3) {
  return html`<section aria-labelledby="account-section-title">
    ${Heading({
      level,
      content: "Account security",
      props: { id: "account-section-title", class: "section-title" },
    })}
    <p>Review the devices and credentials that can access this account.</p>
  </section>`;
}

export const AccountPage = html`<main>
    <h1>Account settings</h1>
    ${AccountSection(2)}
  </main>`;

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source