0.11.4 • Published 1 month ago

@snack-uikit/toaster v0.11.4

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

Toaster

Installation

npm i @snack-uikit/toaster

Changelog

Usage

import { toaster } from '@snack-uikit/toaster';

// create userAction toast
const userActionId = await toaster.userAction.success({ label, id });

// create systemEvent toast
const systemEventId = await toaster.systemEvent.success({ title, description, id });

// update userAction toast
toaster.userAction.update.error(userActionId, { label: 'new text' });

// update systemEvent toast
toaster.systemEvent.update.error(systemEventId, {
    title: 'new text',
    description: 'new description',
});

// dismiss userAction toast
toaster.userAction.dismiss(userActionId);

// dismiss systemEvent toast
toaster.systemEvent.dismiss(systemEventId);

Props

type ToastUserActionLink = {
  text: string;
  href: string;
  onClick?(e: MouseEvent<HTMLAnchorElement>): void;
};

type ToastUserActionProps = Partial<RtToastContentProps> &
  WithSupportProps<{
    label: string;
    link?: ToastUserActionLink;
    className?: string;
    onClose(id?: string | number): void;
  }>;

type ToastSystemEventLink = {
  text: string;
  href: string;
  onClick?(e: MouseEvent<HTMLAnchorElement>): void;
};

type ToastSystemEventProps = Partial<RtToastContentProps> &
  WithSupportProps<{
    title: string;
    description?: string;
    link?: ToastSystemEventLink;
    progressBar?: boolean;
    closable?: boolean;
    className?: string;
    onCloseClick?(e: MouseEvent<HTMLButtonElement>, close?: () => void): void;
    onClose(id?: string | number): void;
  }>;

TODO

  • Translations
0.8.9

6 months ago

0.8.8

7 months ago

0.8.5

7 months ago

0.8.4

8 months ago

0.8.7

7 months ago

0.8.6

7 months ago

0.9.4

4 months ago

0.9.3

4 months ago

0.10.1

4 months ago

0.10.0

4 months ago

0.8.3

8 months ago

0.8.2

8 months ago

0.11.0

3 months ago

0.11.1

2 months ago

0.11.2

2 months ago

0.11.3

2 months ago

0.11.4

2 months ago

0.9.0

4 months ago

0.9.2

4 months ago

0.9.1

4 months ago

0.8.12

5 months ago

0.8.11

5 months ago

0.8.14

4 months ago

0.8.13

5 months ago

0.8.10

6 months ago

0.8.19

4 months ago

0.8.16

4 months ago

0.8.15

4 months ago

0.8.18

4 months ago

0.8.17

4 months ago

0.7.0

9 months ago

0.8.1

9 months ago

0.8.0

9 months ago

0.6.27

10 months ago

0.6.26

10 months ago

0.6.21

1 year ago

0.6.20

1 year ago

0.6.23

12 months ago

0.6.22

12 months ago

0.6.25

10 months ago

0.6.24

10 months ago

0.6.18

1 year ago

0.6.17

1 year ago

0.6.19

1 year ago

0.6.16

1 year ago

0.6.15

1 year ago

0.6.14

1 year ago

0.6.13

1 year ago

0.6.12

1 year ago

0.6.11

1 year ago

0.6.10

1 year ago

0.6.9

1 year ago

0.6.8

1 year ago

0.6.7

1 year ago

0.6.6

1 year ago

0.6.5

1 year ago

0.6.4

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.5

1 year ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago