@splunk/react-toast-notifications
v0.13.0
Published
React toast notification components
Keywords
Readme
@splunk/react-toast-notifications
Deprecated: Toast notifications are deprecated in the Splunk UI design system and should not be used for new experiences. Use Message or MessageBar instead. See Notifications guidance for migration recommendations.
Legacy package for existing applications that still depend on toast behavior.
Install
Install only if you are maintaining existing toast implementations.
- Install the peer dependencies:
npm install react@^16 styled-components@^5 - Install the package:
npm install @splunk/react-toast-notifications
Usage
Legacy usage for existing apps only. Only import these once. See Usage for details.
import ToastMessages from '@splunk/react-toast-notifications/ToastMessages';
import Toaster, { makeCreateToast } from '@splunk/react-toast-notifications/Toaster';import { TOAST_TYPES } from '@splunk/react-toast-notifications/ToastConstants';Production builds
Both @splunk/react-toast-notifications and React support production and development builds. The production build removes warnings and guidance from the output. To create a production build, set the environment variable NODE_ENV to "production" and use the webpack DefinePlugin to inject the variable into the code.
