0.8.3 • Published 5 years ago

@shortcm/react-snackbar v0.8.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

React Button

A React version of an MDC Button.

Installation

npm install @material/react-snackbar

Usage

Styles

with Sass:

import '@material/react-snackbar/index.scss';

with CSS:

import '@material/react-snackbar/dist/snackbar.css';

Javascript Instantiation

import React from 'react';
import Button from '@material/react-snackbar';

class MyApp extends React.Component {
  render() {
    return (
      <Button>
        Click Me!
      </Button>
    );
  }
}

Props

Prop NameTypeDescription
messageStringMessage to show in the snackbar
classNameStringClasses to be applied to the root element.
timeoutMsNumberTimeout in milliseconds when to close snackbar.
closeOnEscapeBooleanCloses popup on "Esc" button if true.
actionTextStringText for action button
leadingBooleanShows snackbar on the left if true (or right for rtl languages)
stackedBooleanShows buttons under text if true
onBeforeOpenFunction() => voidCallback for handling event, which happens before opening
onOpenFunction(evt: Event) => voidCallback for handling event, which happens after opening
onBeforeCloseFunction() => voidCallback for handling event, which happens before closing
onCloseFunction() => voidCallback for handling event, which happens after closing

Sass Mixins

Sass mixins may be available to customize various aspects of the Components. Please refer to the MDC Web repository for more information on what mixins are available, and how to use them.

Advanced Sass Mixins

Usage with Icons

Please see our Best Practices doc when importing or using icon fonts.