Skip to content

Commit

Permalink
Don't link Component with level by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mendrew committed Nov 29, 2023
1 parent bf79a74 commit 512dafe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 1 addition & 5 deletions packages/vkui/src/components/Typography/Title/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ export interface TitleProps extends TypographyProps {
export const Title = ({
className,
level = '1',
Component,
Component = 'span',
normalize = true,
...restProps
}: TitleProps) => {
if (!Component) {
Component = ('h' + level) as React.ElementType;
}

return (
<Typography
Component={Component}
Expand Down
12 changes: 12 additions & 0 deletions styleguide/pages/migration_v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,15 @@
```

<br/><br/>

## Title

По умолчанию тэг в котором рендерится компонент теперь `span` и он больше не привязан к значению свойства `level`.

Переопределить тэг по умолчанию можно с помощью свойства `Component`.

```jsx static
<Title Component="h1" />
```

<br/><br/>

0 comments on commit 512dafe

Please sign in to comment.