Skip to content

Commit

Permalink
feat(Heading): default level is now 2 (#2378)
Browse files Browse the repository at this point in the history
resolves #2358
  • Loading branch information
Barsnes authored Sep 10, 2024
1 parent 0dbcee5 commit 8cdd5c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/rich-carrots-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@digdir/designsystemet-react": patch
---

Heading: default level is now 2
6 changes: 3 additions & 3 deletions packages/react/src/components/Typography/Heading/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { forwardRef } from 'react';
export type HeadingProps = {
/**
* Heading level. This will translate into any h1-6 level unless `asChild` is `true`
* @default 1
* @default 2
*/
level?: 1 | 2 | 3 | 4 | 5 | 6;
/** Changes text sizing
Expand All @@ -31,10 +31,10 @@ export type HeadingProps = {
*/
export const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(
(
{ size = 'xl', level = 1, spacing = false, className, asChild, ...rest },
{ size = 'xl', level = 2, spacing = false, className, asChild, ...rest },
ref,
) => {
const Component = asChild ? Slot : (`h${level ?? 1}` as ElementType);
const Component = asChild ? Slot : (`h${level}` as ElementType);

return (
<Component
Expand Down

0 comments on commit 8cdd5c5

Please sign in to comment.