Skip to content

Choose Hx level for Card title #160

@slafayIGN

Description

@slafayIGN

The Card component title is always a h3 :

react-dsfr/src/Card.tsx

Lines 149 to 160 in 39140e5

<h3 className={cx(fr.cx("fr-card__title"), classes.title)}>
{linkProps !== undefined ? (
<Link
{...linkProps}
className={cx(linkProps.className, classes.link)}
>
{title}
</Link>
) : (
title
)}
</h3>

In order not to mess with the actual document hierarchy, we should be able to choose the title level we want.

This has already been done in the Accordion component with a titleAs property. A similar behaviour would be appropriate.

(I can work on the PR later)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions