New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@zendeskgarden/react-notifications

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zendeskgarden/react-notifications

Notification and Well components within the Garden Design System


Version published
Maintainers
0
Created

@zendeskgarden/react-notifications npm version

This package includes several varieties of notifications and wells within the Garden Design System.

Installation

npm install @zendeskgarden/react-notifications

# Peer Dependencies - Also Required
npm install react react-dom styled-components @zendeskgarden/react-theming

Usage

Notifications

import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Notification } from '@zendeskgarden/react-notifications';

/**
 * Place a `ThemeProvider` at the root of your React application
 */
<ThemeProvider>
  <Notification>
    <Notification.Title>Example Title</Notification.Title>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit...
  </Notification>
</ThemeProvider>;

Toasts

import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Button } from '@zendeskgarden/react-buttons';
import { Notification, ToastProvider, useToast } from '@zendeskgarden/react-notifications';

const ToastExample = () => {
  const { addToast } = useToast();

  return (
    <Button
      onClick={() =>
        addToast(({ close }) => (
          <Notification>
            Example notification
            <Notification.Close onClick={close} aria-label="Close" />
          </Notification>
        ))
      }
    >
      Add toast
    </Button>
  );
};

<ThemeProvider>
  <ToastProvider>
    <ToastExample />
  </ToastProvider>
</ThemeProvider>;

FAQs

Package last updated on 18 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts