3.0.1 • Published 8 months ago

@licuido-ui/ui_snackbar v3.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Snackbar

Snackbars provide brief notifications. The component is also known as a toast.

Author

Link

Story Book Link stepper

PlayGround

Try it have a fun codeBox

Installation

npm i @licuido-ui/ui_snackbar

Import component

import { Snackbar } from '@licuido-ui/ui_snackbar';

Usage

<Snackbar message='' open={} />

Image

alt text

Sample Code

<Snackbar
  open={true}
  duration={60000}
  severity="success"
  message="Toast message here"
  anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
  backgroundColor=""
  width=""
  startIcon={<TickIcon />}
  endIcon={<CloseIcon />}
  fontSize=""
  fontWeight={400}
  fontColor=""
/>

Props

NameTypeDefaultDescription
classNamestringAdditional CSS class for styling purposes.
sxSxPropsThe style object that customizes the appearance of the Snackbar.
backgroundColorstringThe background color of the Snackbar.
widthstringThe width of the Snackbar.
openbooleantrueControls whether the Snackbar is visible.
severity'error' or 'success' or 'warning' or 'info''success'The severity of the alert.
durationnumber60000The duration (in milliseconds) for which the Snackbar should be visible before automatically closing.
handleClose() => voidCallback function to handle the close event.
fontSizestringThe font size of the message.
fontWeightnumber or undefined400The font weight of the message.
fontColorstringThe font color of the message.
messagestring'Toast message here'The message content of the Snackbar.
startIconReact.ReactNode<TickIcon />The icon displayed at the start of the message.
endIconReact.ReactNode<CloseIcon />The icon displayed at the end of the message.
anchorOrigin{ vertical: 'top' or 'bottom'; horizontal: 'left' or 'center' or 'right' }{ vertical: 'top', horizontal: 'center' }The anchor position of the Snackbar.
keystring or undefinedA unique key to identify the Snackbar instance.