1.0.1 • Published 3 years ago

@marcoparrone/iconbutton v1.0.1

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

iconbutton

A Material React component implemeting a button with an icon.

Installation

npm install @marcoparrone/iconbutton

Usage

The IconButton React component accepts there properties:

  • label: a short description of the purpose of the button
  • icon: the Material icon name, see https://material.io/resources/icons/ for the full collection
  • callback: the function to call when the button is pressed
import IconButton from '@marcoparrone/iconbutton';

// ...

<IconButton label="Add a bookmark" icon='add' callback={event => this.props.addNode(this.props.id)} />

It is important to include the material icons in the HTML page. I usually include them directly in the static HTML page:

<!DOCTYPE html>
<html lang="en">
  <head>
...
  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
...
  </head>
  <body>
...
  </body>
</html>