@@ -51,6 +51,7 @@ interface ToastProps {
51
51
descriptionClassName ?: string ;
52
52
loadingIcon ?: React . ReactNode ;
53
53
classNames ?: ToastClassnames ;
54
+ closeButtonAriaLabel ?: string ;
54
55
}
55
56
56
57
function cn ( ...classes : ( string | undefined ) [ ] ) {
@@ -81,6 +82,7 @@ const Toast = (props: ToastProps) => {
81
82
loadingIcon : loadingIconProp ,
82
83
expandByDefault,
83
84
classNames,
85
+ closeButtonAriaLabel = 'Close toast' ,
84
86
} = props ;
85
87
const [ mounted , setMounted ] = React . useState ( false ) ;
86
88
const [ removed , setRemoved ] = React . useState ( false ) ;
@@ -325,7 +327,7 @@ const Toast = (props: ToastProps) => {
325
327
>
326
328
{ closeButton && ! toast . jsx ? (
327
329
< button
328
- aria-label = "Close toast"
330
+ aria-label = { closeButtonAriaLabel }
329
331
data-disabled = { disabled }
330
332
data-close-button
331
333
onClick = {
@@ -450,6 +452,7 @@ const Toaster = (props: ToasterProps) => {
450
452
dir = getDocumentDirection ( ) ,
451
453
gap,
452
454
loadingIcon,
455
+ containerAriaLabel = 'Notifications' ,
453
456
} = props ;
454
457
const [ toasts , setToasts ] = React . useState < ToastT [ ] > ( [ ] ) ;
455
458
const possiblePositions = React . useMemo ( ( ) => {
@@ -581,7 +584,7 @@ const Toaster = (props: ToasterProps) => {
581
584
582
585
return (
583
586
// Remove item from normal navigation flow, only available via hotkey
584
- < section aria-label = { `Notifications ${ hotkeyLabel } ` } tabIndex = { - 1 } >
587
+ < section aria-label = { `${ containerAriaLabel } ${ hotkeyLabel } ` } tabIndex = { - 1 } >
585
588
{ possiblePositions . map ( ( position , index ) => {
586
589
const [ y , x ] = position . split ( '-' ) ;
587
590
return (
0 commit comments