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

@snack-uikit/alert

Package Overview
Dependencies
Maintainers
0
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snack-uikit/alert

  • 0.15.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76
decreased by-76.9%
Maintainers
0
Weekly downloads
 
Created
Source

Alert

Installation

npm i @snack-uikit/alert

Changelog

Example

import { Alert, AlertTop } from '@snack-uikit/alert';
import { InfoFilledSVG } from '@snack-uikit/icons';

// Alert component displays a notification with an optional icon, title, description, and link.
// It can be used to provide information, warnings, errors, or success messages.

<Alert
  appearance='neutral'
  link={{
    text: 'Link text',
    href: 'https://cloud.ru/',
  }}
  title='Title'
  description='Title description'
  onClose={() => console.log('alert')}
/>;

// AlertTop component is similar to Alert but is positioned at the top of the screen.
// It can have an additional button with customizable text, icon, and click handler.

<AlertTop
  appearance='neutral'
  link={{
    text: 'Link text',
    href: 'https://cloud.ru/',
  }}
  closeable
  title='Title'
  description='Title description'
  action={{
    text: 'Button Text',
    icon: <PlaceholderSVG />,
    onClick: () => {},
  }}
  onClose={() => console.log('alert top')}
/>;

Alert

Компонент для отображения уведомления.

Props

nametypedefault valuedescription
description*ReactNode-Описание
iconbooleantrueОтображать иконку
titlestring-Заголовок
truncate{ title?: number; }'{
title: 1 }'
Максимальное кол-во строк
- title - в заголовке
linkPick<LinkProps, "text" | "target" | "onClick" | "href" | "appearance">-Cсылка
onClose() => void-Колбек закрытия
appearanceenum Appearance: "neutral", "primary", "error", "warning", "success", "info"neutralВнешний вид
outlineboolean-Внешний бордер
sizeenum Size: "s", "m"mРазмер
classNamestring-CSS-класс
actions{ primary: Omit<AlertButtonProps, "appearance">; secondary?: Omit<AlertButtonProps, "appearance">; }-Кнопки в футере алерта

AlertTop

Компонент для отображения уведомления вверху экрана.

Props

nametypedefault valuedescription
description*ReactNode-Описание
iconbooleantrueОтображать иконку
titlestring-Заголовок
truncate{ title?: number; }'{
title: 1 }'
Максимальное кол-во строк
- title - в заголовке
linkPick<LinkProps, "text" | "target" | "onClick" | "href" | "appearance">-Cсылка
actionAlertButtonProps-Кнопка дополнительного действия
onClose() => void-Колбек закрытия
appearanceenum Appearance: "neutral", "primary", "error", "warning", "success", "info"neutralВнешний вид
classNamestring-CSS-класс

FAQs

Package last updated on 20 Jan 2025

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc