Styling Methods
Style Object
Use thestyle option to apply inline CSS styles:
style option accepts a SolidJS JSX.CSSProperties object. Note that CSS properties should be in kebab-case or camelCase.
CSS Classes
Apply custom CSS classes using theclassName option:
Container Styling
Style the toast container using theToaster component:
Default Styling
Set default styles for all toasts via theToaster component:
Icon Theming
Icon Theme Colors
Customize the colors of default icons (success, error, loading) usingiconTheme:
iconTheme object has two properties:
- primary: Main color of the icon
- secondary: Accent/background color of the icon
Custom Icons
Replace the default icon entirely with a custom one:Practical Examples
Dark Theme Toast
Success with Custom Colors
Error with Custom Styling
Combining Styles and Classes
You can use bothstyle and className together:
style object will be applied as inline styles and will override any conflicting styles from the CSS class.