0.16.9 • Published 1 month ago

@snack-uikit/alert v0.16.9

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 month ago

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-класс
0.15.10

5 months ago

0.15.13

4 months ago

0.15.14

4 months ago

0.15.11

5 months ago

0.15.12

5 months ago

0.15.15

4 months ago

0.15.16

4 months ago

0.15.4

7 months ago

0.15.5

7 months ago

0.15.6

7 months ago

0.15.7

7 months ago

0.15.8

6 months ago

0.15.9

6 months ago

0.15.2

8 months ago

0.15.3

8 months ago

0.16.3

4 months ago

0.16.4

4 months ago

0.16.5

4 months ago

0.16.6

4 months ago

0.16.7

2 months ago

0.16.8

2 months ago

0.16.9

2 months ago

0.16.0

4 months ago

0.16.1

4 months ago

0.16.2

4 months ago

0.15.0

9 months ago

0.15.1

9 months ago

0.14.0

9 months ago

0.13.6

10 months ago

0.13.5

10 months ago

0.11.0

1 year ago

0.11.1

1 year ago

0.13.0

12 months ago

0.11.2

1 year ago

0.13.1

11 months ago

0.11.3

1 year ago

0.13.2

10 months ago

0.11.4

1 year ago

0.13.3

10 months ago

0.11.5

12 months ago

0.13.4

10 months ago

0.12.0

12 months ago

0.12.1

12 months ago

0.10.4

1 year ago

0.10.5

1 year ago

0.10.3

1 year ago

0.10.2

1 year ago

0.10.1

1 year ago

0.10.0

1 year ago

0.9.2

1 year ago

0.9.0

1 year ago

0.9.1

1 year ago

0.8.7

1 year ago

0.8.6

1 year ago

0.8.5

1 year ago

0.8.4

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.8.1

1 year ago

0.8.0

2 years ago

0.7.3

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago