next
This commit is contained in:
1 parent
b244287f6a
commit
5a2d49c17f
77 files changed
+2289
-31
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export interface HeadingProps {
|
||||
/** 2 for a section headline, 3 for a block within it. Never skip a level. */
|
||||
level?: 2 | 3;
|
||||
id?: string;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
/** A section headline. It may state a claim, but it never advertises. */
|
||||
export function Heading({ level = 2, id, children }: HeadingProps) {
|
||||
const Tag = level === 3 ? 'h3' : 'h2';
|
||||
return (
|
||||
<Tag id={id} className={level === 3 ? 'h3' : 'h2'}>
|
||||
{children}
|
||||
</Tag>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user