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>({
1313
1414export type ToastAlignment = "start" | "end" ;
1515export type ToastType = "danger" | "warning" | "default" | "success" ;
16- export interface ToastProps {
16+ export interface ToastProps extends Omit < RadixUIToast . ToastProps , "type" > {
1717 id ?: string ;
1818 type ?: ToastType ;
19+ toastType ?: "foreground" | "background" ;
1920 title : string ;
2021 description ?: ReactNode ;
2122 /** Time in milliseconds the toast will be visible */
@@ -128,11 +129,14 @@ const Title = styled.div`
128129
129130export const Toast = ( {
130131 type,
132+ toastType = "foreground" ,
131133 title,
132134 description,
133135 actions = [ ] ,
134136 duration,
135137 onClose,
138+
139+ ...props
136140} : ToastProps & { onClose : ( open : boolean ) => void } ) => {
137141 let iconName = "" ;
138142 if ( type === "default" ) {
@@ -146,6 +150,8 @@ export const Toast = ({
146150 < ToastRoot
147151 onOpenChange = { onClose }
148152 duration = { duration }
153+ type = { toastType }
154+ { ...props }
149155 >
150156 < ToastHeader >
151157 { iconName . length > 0 && (
You can’t perform that action at this time.
0 commit comments