Skip to content

Conversation

krishnagkmit
Copy link
Contributor

PR: fix(card): add form id and button form prop

Issue

  • In one of the examples for the Card component used a button placed outside the <form/> without a form prop, which is incorrect and can break form submission behaviour.

Fixes:

  • Adds an id prop to Form and a form prop to Button so buttons outside forms can target them natively.

Why

  • Enables declarative form targeting for buttons that are not nested in a form (better accessibility, simpler
    markup).

Usage

<Form id="signup-form">...</Form>

// Button outside the form
<Button form="signup-form" type="submit">Sign up</Button>

Copy link

vercel bot commented Oct 12, 2025

@krishnagkmit is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant