The Toast
component uses Alert
under the hood.
Alert
maps the status
prop to a color scheme. This color scheme is used in the theme definition to define the background color.
By default, status="info"
maps to blue
and the subtle
variant is used.
EDIT (Chakra >= 2.0): Toast now uses the solid
variant by default. In the following solution, replace subtle
with solid
to modify the default appearance.
Hence you would need add an override like this to your theme definition:
import { theme as origTheme, extendTheme } from "@chakra-ui/react"
const theme = extendTheme({
components: {
Alert: {
variants: {
subtle: (props) => { // only applies to `subtle` variant
const { colorScheme: c } = props
if (c !== "blue") {
// use original definition for all color schemes except "blue"
return origTheme.components.Alert.variants.subtle(props)
}
return {
container: {
bg: `${c}.500`, // or literal color, e.g. "#0984ff"
},
}
}
}
}
}
})
Color variables like blue.500
are read from the color definitions.