🤖 [react] Add commandFor and command attributes to ButtonHTMLAttributes#75012
🤖 [react] Add commandFor and command attributes to ButtonHTMLAttributes#75012algojogacor wants to merge 2 commits into
Conversation
These attributes are part of the Invoker Commands API (open-ui.org), supported in Chrome/Edge 135+, Safari TP, and Firefox Nightly. Closes DefinitelyTyped#74664
|
@algojogacor Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment that I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 10 days. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 75012,
"author": "algojogacor",
"headCommitOid": "ea47bfd1ac01c329accc8a796aa433e7ce8db318",
"mergeBaseOid": "c6fb7d2e0e833931ac92da131709d2c6178ce3d8",
"lastPushDate": "2026-05-17T08:16:16.000Z",
"lastActivityDate": "2026-05-17T08:16:16.000Z",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"tooManyCommits": false,
"tooManyReviews": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "react",
"kind": "edit",
"files": [
{
"path": "types/react/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/test/elementAttributes.tsx",
"kind": "test"
},
{
"path": "types/react/ts5.0/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/v18/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/v18/ts5.0/index.d.ts",
"kind": "definition"
}
],
"owners": [
"johnnyreilly",
"bbenezech",
"pzavolinsky",
"ericanderson",
"DovydasNavickas",
"theruther4d",
"guilhermehubner",
"ferdaber",
"jrakotoharisoa",
"pascaloliv",
"hotell",
"franklixuefei",
"Jessidhia",
"saranshkataria",
"lukyth",
"eps1lon",
"zieka",
"dancerphil",
"dimitropoulos",
"disjukr",
"vhfmag",
"priyanshurav",
"Semigradsky",
"mattpocock"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [],
"mainBotCommentID": 4469873452,
"ciResult": "pass"
} |
|
🔔 @johnnyreilly @bbenezech @pzavolinsky @ericanderson @DovydasNavickas @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @eps1lon @zieka @dancerphil @dimitropoulos @disjukr @vhfmag @priyanshurav @Semigradsky @mattpocock — please review this PR in the next few days. Be sure to explicitly select |
Fixes #74664
Summary
Add
commandForandcommandHTML attributes from the Invoker Commands API to React'sButtonHTMLAttributesinterface across all supported type versions.Documentation
Browser Support
Changes
types/react/index.d.ts: addcommand?: string | undefinedandcommandFor?: string | undefined(+2)types/react/ts5.0/index.d.ts: same (+2)types/react/v18/index.d.ts: same (+2)types/react/v18/ts5.0/index.d.ts: same (+2)types/react/test/elementAttributes.tsx: add test cases for all 3 command value forms — built-in (toggle-popover,show-modal) and custom (--custom-action) (+5 -1)Testing
<button commandFor="my-popover" command="toggle-popover">: compiles ✅<button commandFor="my-dialog" command="show-modal">: compiles ✅<button commandFor="custom" command="--custom-action">: custom prefixed values compile ✅