0.11.4 • Published 5 months ago

@snack-uikit/toaster v0.11.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months 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

10 months ago

0.8.8

10 months ago

0.8.5

11 months ago

0.8.4

11 months ago

0.8.7

10 months ago

0.8.6

11 months ago

0.9.4

8 months ago

0.9.3

8 months ago

0.10.1

7 months ago

0.10.0

8 months ago

0.8.3

12 months ago

0.8.2

12 months ago

0.11.0

6 months ago

0.11.1

6 months ago

0.11.2

6 months ago

0.11.3

5 months ago

0.11.4

5 months ago

0.9.0

8 months ago

0.9.2

8 months ago

0.9.1

8 months ago

0.8.12

9 months ago

0.8.11

9 months ago

0.8.14

8 months ago

0.8.13

9 months ago

0.8.10

9 months ago

0.8.19

8 months ago

0.8.16

8 months ago

0.8.15

8 months ago

0.8.18

8 months ago

0.8.17

8 months ago

0.7.0

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.6.27

1 year ago

0.6.26

1 year ago

0.6.21

1 year ago

0.6.20

1 year ago

0.6.23

1 year ago

0.6.22

1 year ago

0.6.25

1 year ago

0.6.24

1 year 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

2 years ago

0.6.12

2 years ago

0.6.11

2 years ago

0.6.10

2 years ago

0.6.9

2 years ago

0.6.8

2 years ago

0.6.7

2 years ago

0.6.6

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.5

2 years 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