A React version of an MDC Floating Action Button.
npm install @material/react-fab
The Fab can be used with the span
, i
, img
or svg
elements. It can also be used with the
Material Icon react component.
<Fab>
<span className="material-icons">favorite</span>
</Fab>
<Fab>
<i className="material-icons">favorite</i>
</Fab>
<Fab>
<svg xmlns="http://www.w3.org/2000/svg" className="material-icons" viewBox="0 0 24 24">
...
</svg>
</Fab>
<Fab>
<img className="material-icons" src="/images/ic_button_24px.svg"/>
</Fab>
<Fab>
<MaterialIcon icon="favorite"/>
</Fab>
Prop Name | Type | Description |
---|---|---|
className | String | Classes to be applied to the root element. |
mini | n/a | Enables the mini variant. |
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.