Material Bread
v0.2.10
Home
Getting Started
React Native
Web
Electron
MacOS
Windows
NextJs
Expo
Vue Native
Style
Font
Icons
Theme
Components
Appbar
Searchbar
Appbar Bottom
Avatar
Backdrop
Badge
Banner
Bottom Navigation
Bottom Navigation Item
Button
Card
CardActions
CardContent
CardHeader
CardMedia
Checkbox
Chip
DataTable
DataTableCell
DataTableHeader
DataTablePagination
DataTableRow
Dialog
Divider
Drawer
DrawerHeader
DrawerItem
DrawerSection
DrawerBottom
Fab
Speed dial
Icon
IconButton
List
ListExpand
ListItem
ListSection
Menu
MenuItem
Paper
Progress Bar
Progress Circle
Radio Button
Ripple
Select
SheetBottom
SheetSide
Slider
Snackbar
SwipeNav
Switch
Tabs
Tab
Textfield
Searchfield
ToggleButton
ToggleButtonGroup
Tooltip
Typography
Utils
Anchor
Color
Hoverable
Shadow
Storybook
Showcase
Contributing
Library
Docs
About

Snackbar

Snackbars provide brief messages about app processes at the bottom of the screen. - Material Docs

import { Snackbar } from 'material-bread';

Component #

Snackbars will show at the bottom of the containing component.
OPEN SNACKBAR
This is a snackbar component
OK
Live Editing
class Demo extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      show: false
    }
  }
  render() {
    return (
      <View >
        <Button
          type="outlined"
          onPress={() => this.setState({ show: true })}
          textColor={'#6E2CFA'}
          text={'Open Snackbar'}
        />
        <Snackbar
          visible={this.state.show}
          action={
            <Button
              type="text"
              onPress={() => this.setState({ show: false })}
              text={'ok'}
              textColor={'#6E2CFA'}
            />
          }>
          {'This is a snackbar component'}
        </Snackbar>
      </View>
    );
  }
}

Usage #

import React, { Component } from 'react';
import { View } from 'react-native';
import { Snackbar, Button } from 'material-bread';

class Demo extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      show: false
    }
  }
  render() {
    return (
      <View >
        <Button
          type="outlined"
          onPress={() => this.setState({ show: true })}
          textColor={'#6E2CFA'}
          text={'Open Snackbar'}
        />
        <Snackbar
          visible={this.state.show}
          action={
            <Button
              type="text"
              onPress={() => this.setState({ show: false })}
              text={'ok'}
              textColor={'#6E2CFA'}
            />
          }>
          {'This is a snackbar component'}
        </Snackbar>
      </View>
    );
  }
}

Props #

Name
Description
Type
Default
animationDuration
Duration of entering and leaving animation
number
action
The action after the message, at the end of the snackbar
node
style
Styles root element
object
visible
Whether snackbar is visible
bool
false