File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,10 @@ export const ToastContext = createContext<ToastContextProps>({
13
13
14
14
export type ToastAlignment = "start" | "end" ;
15
15
export type ToastType = "danger" | "warning" | "default" | "success" ;
16
- export interface ToastProps {
16
+ export interface ToastProps extends Omit < RadixUIToast . ToastProps , "type" > {
17
17
id ?: string ;
18
18
type ?: ToastType ;
19
+ toastType ?: "foreground" | "background" ;
19
20
title : string ;
20
21
description ?: ReactNode ;
21
22
/** Time in milliseconds the toast will be visible */
@@ -128,11 +129,14 @@ const Title = styled.div`
128
129
129
130
export const Toast = ( {
130
131
type,
132
+ toastType = "foreground" ,
131
133
title,
132
134
description,
133
135
actions = [ ] ,
134
136
duration,
135
137
onClose,
138
+
139
+ ...props
136
140
} : ToastProps & { onClose : ( open : boolean ) => void } ) => {
137
141
let iconName = "" ;
138
142
if ( type === "default" ) {
@@ -146,6 +150,8 @@ export const Toast = ({
146
150
< ToastRoot
147
151
onOpenChange = { onClose }
148
152
duration = { duration }
153
+ type = { toastType }
154
+ { ...props }
149
155
>
150
156
< ToastHeader >
151
157
{ iconName . length > 0 && (
You can’t perform that action at this time.
0 commit comments