Socket
Socket
Sign inDemoInstall

@wedgekit/alerts

Package Overview
Dependencies
97
Maintainers
18
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @wedgekit/alerts

## Purpose


Version published
Maintainers
18
Created

Readme

Source

Alert

Purpose

The Alert component is used to alert a user of a serious error or attempt to warn them of a potential error.

Basic Implementation

import Alert from '@wedgekit/alerts';

const Test = () => {
  const errorBodyFromAPI = 'There has been a grievous error that you must attend to.';

  return <Alert detail={errorBodyFromAPI}>There has been a critical error!</Alert>;
};

render(<Test />);

Props

children

Type: string

Required: ✅

The primary alert message

detail

Type: string

Required: ❌

Additional details that will be displayed to the user when they click "show details"

id

Type: string

Required: ❌

An ID which will be passed through to the DOM; potentially useful for ARIA purposes

warning

Type: boolean

Required: ❌

Alerts default to critical or "danger," however warning can optionally set as true to display alerts as less life-threatening.

onClose

Type: (event: SyntheticEvent<Element, Event>) => void

Required: ✅

Callback when the user presses the close button

FAQs

Last updated on 11 Nov 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc