-
-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Card title tag not changing #1531
Comments
So the shadcn-svelte docs are incorrect here. The behavior is consistent with the original library the original library doesn't have a level prop I assume because they allow you to supply the aria-level on your own. But the level here is a nice shorthand for that. const CardTitle = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"text-2xl font-semibold leading-none tracking-tight",
className
)}
{...props}
/>
))
CardTitle.displayName = "CardTitle" There is a change for this in the original library moving from h3 -> div https://ui.shadcn.com/docs/components/card#changelog I think the docs just need to be corrected here. |
I see, I was just confused because of the docs. It should be corrected, agreed. |
Closed by #1543 |
Describe the bug
I can't change the tag of the Card.Title. I'm getting a TypeScript error:
Object literal may only specify known properties, and '"tag"' does not exist in type 'HTMLAttributes<HTMLDivElement> & { ref?: HTMLElement | null | undefined; } & { level?: 1 | 2 | 3 | 4 | 5 | 6 | undefined; }'.ts(2353)
In Svelte 4 this worked flawlessly, but in Svelte 5 (and shadcn-svelte@next) the tag prop is not even being suggested by the IDE. Only relevant prop I have available is 'level'
Also in the docs I see this:
By default, the <Card.Title> component renders an <h3> element.
This is not true for me, the title is using this element:
<div role="heading" aria-level="3">
Reproduction
Simply install the card component with
npx shadcn-svelte@next add card
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: