Giter Club home page Giter Club logo

material-ui-banner's Introduction

material-ui-banner

Bringing the Material Design banner component to the material-ui library. Spec here: https://material.io/design/components/banners.html

Installation

npm install material-ui-banner --save

Usage

To embed a banner anywhere on the page

<Banner
  icon={<div />}
  label="Text goes here"
  open
/>

To add a static banner to the top of the page

<AppBar>
  <Toolbar />
</AppBar>

<StaticBanner />

You would then open the banner elsewhere in the app like so:

StaticBanner.show({
  icon: <div />,
  label: 'This is an example of a static banner with one line of text.',
});

Please refer to src/demo for examples.

Options

These options are compatible with both <Banner> and StaticBanner.show()

Name Type Description Default
open boolean (required) Indicates whether or not the banner is displayed false
label string (required) Text label that appears on the banner ''
icon element Material icon to be displayed on the left side of the banner null
iconProps object Additional properties that can be passed to the icon. See https://material-ui.com/api/avatar/ {}
showDismissButton boolean Whether or not to display the default "Dismiss" button true
dismissButtonLabel string Text label for the default "Dismiss" button 'Dismiss'
onClose function Callback invoked when clicking the Dismiss button. StaticBanner passes a close handler automatically null
buttonLabel string If provided, add a second button (or only button, if the dismiss button is hidden) null
buttonOnClick function Click event handler for the custom second button null
buttonComponent element The element to be used for the custom second button (passed as component={buttonComponent} in MuiButton) 'button'
buttonProps objct Additional properties that can be passed to the button. See https://material-ui.com/api/button/ {}
paperProps objct Additional properties that can be passed to the Paper component. See https://material-ui.com/api/paper/ {}
cardProps objct Additional properties that can be passed to the Card component. See https://material-ui.com/api/card/ {}
appBar boolean Set to true if the banner should appear at the very top of the page beneath the AppBar component false

License

Uses the MIT License

material-ui-banner's People

Contributors

alexplumb avatar benmidi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.