- Prop
level- Type
2 | 1 | 3 | 4 | undefined- Default
2- Requirement
- optional
- Description
- Heading level 1–4, also sets the default tag (h1–h4).
Docs Components Primitives
Heading
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
const headingFixture = { id: "heading", text: "Software you can stop worrying about.", level: 2,} satisfies { id: string; text: string; level: 1 | 2 | 3 | 4 }; import { Heading } from "@grassroot/ui-react"; export default function HeadingDemo() { return ( <div> <Heading level={headingFixture.level}>{headingFixture.text}</Heading> </div> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script setup lang="ts">import { Heading } from "@grassroot/ui-vue";const headingFixture = { id: "heading", text: "Software you can stop worrying about.", level: 2,} satisfies { id: string; text: string; level: 1 | 2 | 3 | 4 }; </script> <template> <div> <Heading :level="headingFixture.level">{{ headingFixture.text }}</Heading> </div></template>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
import { Component } from "@angular/core";import { GrassrootHeading } from "@grassroot/ui-angular";const headingFixture = { id: "heading", text: "Software you can stop worrying about.", level: 2,} satisfies { id: string; text: string; level: 1 | 2 | 3 | 4 }; @Component({ selector: "app-heading-demo", standalone: true, imports: [GrassrootHeading], template: ` <div> <grassroot-heading [level]="fixture.level">{{ fixture.text }}</grassroot-heading> </div> `,})export class HeadingDemoComponent { protected readonly fixture = headingFixture;} export default HeadingDemoComponent;- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script lang="ts"> import { Heading } from "@grassroot/ui-svelte"; const headingFixture = { id: "heading", text: "Software you can stop worrying about.", level: 2, } satisfies { id: string; text: string; level: 1 | 2 | 3 | 4 }; </script> <div><Heading level={headingFixture.level}>{headingFixture.text}</Heading></div>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
/** @jsxImportSource solid-js */import { Heading } from "@grassroot/ui-solid";const headingFixture = { id: "heading", text: "Software you can stop worrying about.", level: 2,} satisfies { id: string; text: string; level: 1 | 2 | 3 | 4 }; export default function HeadingDemo() { return ( <div> <Heading level={headingFixture.level}>{headingFixture.text}</Heading> </div> );}Installation
API Reference
Import
import { Heading } from "@grassroot/ui-react";
Props
Prop
Type
Default
Requirement
Description
level2 | 1 | 3 | 4 | undefined2optional
Heading level 1–4, also sets the default tag (h1–h4).
asReact.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined—
optional
Override the rendered element without changing the visual size.
emphasisboolean | undefinedfalseoptional
Bump to the emphasized weight (M3 Expressive) for the loudest title on a surface.
- Prop
as- Type
React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined- Default
- —
- Requirement
- optional
- Description
- Override the rendered element without changing the visual size.
- Prop
emphasis- Type
boolean | undefined- Default
false- Requirement
- optional
- Description
- Bump to the emphasized weight (M3 Expressive) for the loudest title on a surface.
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.
Import
import { Heading } from "@grassroot/ui-vue";
Props
Prop
Type
Default
Requirement
level1 | 2 | 3 | 4 | undefined2optional
asstring | undefined—
optional
emphasisboolean | undefinedfalseoptional
- Prop
level- Type
1 | 2 | 3 | 4 | undefined- Default
2- Requirement
- optional
- Prop
as- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
emphasis- Type
boolean | undefined- Default
false- Requirement
- optional
Content regions
default
Import
import { Component } from "@angular/core";
import { GrassrootHeading } from "@grassroot/ui-angular";
Props
Prop
Type
Default
Requirement
level1 | 2 | 3 | 42optional
as"h1" | "h2" | "h3" | "h4" | "div" | "p" | "span" | undefinedundefinedoptional
emphasisbooleanfalseoptional
- Prop
level- Type
1 | 2 | 3 | 4- Default
2- Requirement
- optional
- Prop
as- Type
"h1" | "h2" | "h3" | "h4" | "div" | "p" | "span" | undefined- Default
undefined- Requirement
- optional
- Prop
emphasis- Type
boolean- Default
false- Requirement
- optional
Content regions
default
Import
import { Heading } from "@grassroot/ui-svelte";
Props
Prop
Type
Default
Requirement
level1 | 2 | 3 | 42optional
asstring—
optional
emphasisbooleanfalseoptional
classstring—
optional
- Prop
level- Type
1 | 2 | 3 | 4- Default
2- Requirement
- optional
- Prop
as- Type
string- Default
- —
- Requirement
- optional
- Prop
emphasis- Type
boolean- Default
false- Requirement
- optional
- Prop
class- Type
string- Default
- —
- Requirement
- optional
Content regions
children
Import
import { Heading } from "@grassroot/ui-solid";
Props
Prop
Type
Default
Requirement
level1 | 2 | 3 | 4—
optional
asstring—
optional
emphasisboolean—
optional
classNamestring—
optional
- Prop
level- Type
1 | 2 | 3 | 4- Default
- —
- Requirement
- optional
- Prop
as- Type
string- Default
- —
- Requirement
- optional
- Prop
emphasis- Type
boolean- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
Content regions
children
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.