Skip to content

Commit 725c737

Browse files
authored
feat(button): add a11yAttrs to slot types
Ideally the types would only suggest it when the asChild option is set to true, but I suspect that we cannot do that without composition API and the generic types - even then it could be very messy.
1 parent 536d21c commit 725c737

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/primevue/src/button/Button.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,13 @@ export interface ButtonSlots {
227227
/**
228228
* Custom content such as icons, images and text can be placed inside the button via the default slot. Note that when slot is used, label, icon and badge properties are not included.
229229
*/
230-
default(): VNode[];
230+
default(scope: {
231+
/**
232+
* Object containing the accessibility attributes.
233+
* @remarks Only available when {@link ButtonProps.asChild} is set to true.
234+
*/
235+
a11yAttrs?: Record<string, unknown>
236+
}): VNode[];
231237
/**
232238
* Custom icon template.
233239
* @param {Object} scope - icon slot's params.

0 commit comments

Comments
 (0)