heading.tsx

src/components/heading.tsx
import React from 'react'
import { clsx } from 'clsx'
import type { HTMLAttributes } from 'react'
import { generateIdFromChildren } from '@/tools/generate-id-from-children'
type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
children?: React.ReactNode
className?: string
/** Custom ID for the heading. If not provided, will be auto-generated from children content */
id?: string
/** The HTML heading tag to render (h1, h2, h3, h4, h5, h6) */
as?: HeadingLevel
/** The heading level to use for styling (independent of the HTML tag) */
styleAs?: HeadingLevel
/** Font size override */
fontSize?: string
/** Font weight override */
fontWeight?: string

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC