From 1d370085fb2792b71b944f008c15ae5edbf3997f Mon Sep 17 00:00:00 2001 From: Rody Molenaar Date: Wed, 29 Nov 2023 05:24:12 +0100 Subject: [PATCH] Props for toast container and close button aria-labels (#239) --- src/index.tsx | 7 +++++-- src/types.ts | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 9403a85..c1229ee 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -51,6 +51,7 @@ interface ToastProps { descriptionClassName?: string; loadingIcon?: React.ReactNode; classNames?: ToastClassnames; + closeButtonAriaLabel?: string; } function cn(...classes: (string | undefined)[]) { @@ -81,6 +82,7 @@ const Toast = (props: ToastProps) => { loadingIcon: loadingIconProp, expandByDefault, classNames, + closeButtonAriaLabel = 'Close toast', } = props; const [mounted, setMounted] = React.useState(false); const [removed, setRemoved] = React.useState(false); @@ -325,7 +327,7 @@ const Toast = (props: ToastProps) => { > {closeButton && !toast.jsx ? (