Skip to content
Back to skills

Notification

ASecurity

Toast notification system with variants, auto-dismiss, flood prevention, and custom components. Wrap your app in `<Notifications>` and use `useNotification` hook to trigger.

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 27, 2026
developmenttypescriptreactnode

Works with

  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add reaviz/skills --skill notification --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Notification?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Notification
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reaviz-notification/badge)](https://www.skillsdirectory.com/skills/reaviz-notification)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Notification

Toast notification system with variants, auto-dismiss, flood prevention, and custom components. Wrap your app in `<Notifications>` and use `useNotification` hook to trigger.

## Import

```tsx
import { Notifications, useNotification } from 'reablocks';
```

## Setup

Wrap your app (or a section) in the Notifications provider:

```tsx
<Notifications>
  <App />
</Notifications>
```

### Notifications Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `limit` | `number` | `10` | Maximum visible notifications |
| `timeout` | `number` | `4000` | Auto-dismiss delay in ms |
| `showClose` | `boolean` | `true` | Show close button |
| `preventFlooding` | `boolean` | `true` | Prevent duplicate messages |
| `className` | `string` | — | CSS classes for notifications |
| `components` | `{ [variant]: ComponentType }` | — | Custom notification components per variant |
| `icons` | `{ [variant]: ReactNode }` | built-in SVGs | Custom icons per variant |
| `theme` | `NotificationTheme` | — | Per-instance theme override |

## useNotification Hook

```tsx
function MyComponent() {
  const {
    notify,
    notifySuccess,
    notifyError,
    notifyWarning,
    notifyInfo,
    clearNotification,
    clearAllNotifications
  } = useNotification();

  return (
    <>
      <Button onClick={() => notify('Default message')}>Notify</Button>
      <Button onClick={() => notifySuccess('Saved!')}>Success</Button>
      <Button onClick={() => notifyError('Failed!')}>Error</Button>
      <Button onClick={() => notifyWarning('Careful!')}>Warning</Button>
      <Button onClick={() => notifyInfo('FYI...')}>Info</Button>
      <Button onClick={() => clearAllNotifications()}>Clear All</Button>
    </>
  );
}
```

## Notification Options

Both `notify()` and variant methods accept a second options argument:

```tsx
notify('Title', {
  body: 'Additional details here',          // Body text (string or ReactNode)
  variant: 'success',                       // default | success | error | warning | info
  timeout: 6000,                            // Override auto-dismiss delay
  showClose: true,                          // Show close button
  icon: <CustomIcon />,                     // Override icon
  action: <Button size="small">Undo</Button>, // Action element
  className: 'custom-class'                 // Additional CSS classes
});
```

## Custom Notification Components

```tsx
<Notifications
  components={{
    error: ({ message, onClose }) => (
      <div className="custom-error">
        {message}
        <button onClick={onClose}>Dismiss</button>
      </div>
    )
  }}
>
  <App />
</Notifications>
```

## NotificationTheme Interface

```typescript
interface NotificationTheme {
  container: string;     // Outer container
  positions: string;     // Fixed positioning (bottom-center by default)
  notification: {
    base: string;        // Notification card (flex, min-w, rounded, bg, border)
    variants: {
      default: { base: string; icon?: string };
      success: { base: string; icon?: string };
      error: { base: string; icon?: string };
      warning: { base: string; icon?: string };
      info: { base: string; icon?: string };
    };
    header: string;       // Title area
    content: string;      // Content wrapper
    body: string;         // Body text
    closeContainer: string;
    action: string;       // Action slot
    closeButton: string;  // Close button
  };
}
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.