0.0.53 • Published 1 year ago

toast-lib-react-kra v0.0.53

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Usage example:

import {
  createToast,
  ToastsContainer,
  THEME_VARIANTS,
  TOAST_POSITIONS,
  TOAST_VARIANTS,
  ANIMATION_VARIANTS
} from 'toast-lib-react-kra';

  export function Example() {
    const onClickMakeToast = () => {
        createToast({
        message: 'Hello, World!',
        isAutoClose: true,
        duration: 6000,
        theme: THEME_VARIANTS.dark,
        variant: TOAST_VARIANTS.info,
        animation: ANIMATION_VARIANTS.slide,
        position: TOAST_POSITIONS.bottomRight,
        customColorConfig: {
            background: 'dark',
            text: 'white',
            icon: 'white,
            progressBar: 'white',
        },
    });
  };

  return (
    <>
      <button onClick={onClickMakeToast}>
        Create Toast
      </button>
      <ToastsContainer
        position={position}
        indent={indent}
        toastsGap={toastsGap}
      />
    </>
  );
}

List of config values:

  • message: string,
  • isAutoClose: boolean,
  • duration: number,
  • indent: number
  • toastsGap: number
  • theme: THEME_VARIANTS = { dark, colored, light }
  • position: TOAST_POSITIONS = { topRight, topLeft, bottomRight, bottomLeft }
  • variant: TOAST_VARIANTS = { success, info, danger, warning }
  • aniamtion: ANIMATION_VARIANTS = { slide, fade, scale }
  • customColorConfig: { background: string, text: string, icon: string, progressBar: string}
0.0.51

1 year ago

0.0.41

1 year ago

0.0.53

1 year ago

0.0.42

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.1

1 year ago