The H2 component provides a styled heading element for section titles. It's designed to be visually prominent while maintaining proper hierarchy below H1 headings.
import { H2 } from '@dashflowx/core'export default function H2Example() {return (<H2>Section Title</H2>)}
Preview:
Heading 6
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | '' | Additional CSS classes for the heading |
children | ReactNode | - | The heading text content |
import { H2 } from '@dashflowx/core'export default function BasicH2() {return (<H2>Our Services</H2>)}
Preview:
Our Services
import { H2 } from '@dashflowx/core'export default function StyledH2() {return (<H2 className="text-blue-600 text-center">Featured Products</H2>)}
Preview:
Featured Products
import { H2 } from '@dashflowx/core'export default function CustomH2() {return (<H2 className="text-3xl font-bold text-gray-800 border-b-2 border-green-500 pb-3">Success Stories</H2>)}
Preview:
Success Stories
const sectionHeader = (<H2 className="mb-6">About Us</H2>);
const featureSection = (<H2 className="text-center mb-8">Key Features</H2>);
const productCategory = (<H2 className="mb-4">Electronics</H2>);
Use H2 for main sections under H1.
// ✅ Good - Proper hierarchy<H1>Main Title</H1><H2>Section Title</H2><H3>Subsection Title</H3>// ❌ Avoid - Skipping levels<H1>Main Title</H1><H3>Subsection Title</H3>
Use clear and descriptive section titles.
// ✅ Good - Descriptive<H2>Customer Testimonials</H2>// ❌ Avoid - Generic<H2>Section</H2>
Maintain consistent styling across sections.
// ✅ Good - Consistent<H2 className="mb-6">Section 1</H2><H2 className="mb-6">Section 2</H2>// ❌ Avoid - Inconsistent<H2 className="mb-4">Section 1</H2><H2 className="mb-8">Section 2</H2>
- H1: For main page titles
- H3: For subsection headings
- H4: For sub-subsection headings
- Typography: For general text styling
For the complete API reference and advanced usage patterns, see the H2 API documentation.
