H4

H4 heading component.

Usage

H4Example.tsx
  1. 1
<H4>This is an h4 heading</H4>

Here's the <H4 /> component in action.

This is an h4 heading

Features

  • Drop-in replacement for the native <h4> element.
  • Opts-in to your design system's typographic styles.

Parts and their API

Source

h4.tsx
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
import { forwardRef, type HTMLAttributes } from 'react'
import { cn } from '#app/utils/tailwind-merge.ts'
/**
* A h4 component.
*/
const H4 = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => <h4 ref={ref} className={cn('h4', className)} {...props} />)
H4.displayName = 'H4'
export { H4 }

Styling

tailwind.css
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
.h4 {
@apply text-muted-900 mt-fluid-14 mb-fluid-5 text-fluid-xl max-w-prose font-sans font-bold capitalize;
/* Typographical elements after h4 */
& + .p {
@apply mt-0;
}
}