Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ const Toaster = React.forwardRef<HTMLElement, ToasterProps>(function Toaster(pro
icons,
customAriaLabel,
containerAriaLabel = 'Notifications',
customAriaLive,
customAriaRelevant,
customAriaAtomic,
} = props;
const [toasts, setToasts] = React.useState<ToastT[]>([]);
const filteredToasts = React.useMemo(() => {
Expand Down Expand Up @@ -775,10 +778,10 @@ const Toaster = React.forwardRef<HTMLElement, ToasterProps>(function Toaster(pro
<section
ref={ref}
aria-label={customAriaLabel ?? `${containerAriaLabel} ${hotkeyLabel}`}
aria-live={customAriaLive ?? 'polite'}
aria-relevant={customAriaRelevant ?? 'additions text'}
aria-atomic={customAriaAtomic ?? 'false'}
tabIndex={-1}
aria-live="polite"
aria-relevant="additions text"
aria-atomic="false"
suppressHydrationWarning
data-react-aria-top-layer
>
Expand Down
6 changes: 6 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export function isAction(action: Action | React.ReactNode): action is Action {
}

export type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
export type AriaLive = 'assertive' | 'polite';
export type AriaRelevant = 'additions' | 'removals' | 'additions removals' | 'text' | 'additions text' | 'removals text' | 'all';
export type AriaAtomic = 'true' | 'false';
export interface HeightT {
height: number;
toastId: number | string;
Expand Down Expand Up @@ -147,6 +150,9 @@ export interface ToasterProps {
icons?: ToastIcons;
customAriaLabel?: string;
containerAriaLabel?: string;
customAriaLive?: AriaLive;
customAriaRelevant?: AriaRelevant;
customAriaAtomic?: AriaAtomic;
}

export type SwipeDirection = 'top' | 'right' | 'bottom' | 'left';
Expand Down