import React from 'react'; import { Icon, InlineIcon, addIcon } from '@iconify/react'; import accountIcon from '@iconify/icons-mdi-light/account'; import alertIcon from '@iconify/icons-mdi-light/alert'; import homeIcon from '@iconify/icons-mdi-light/home'; import presentationPlay from '@iconify/icons-mdi-light/presentation-play'; import checkedIcon from '@iconify/icons-uil/check-circle'; import uncheckedIcon from '@iconify/icons-uil/circle'; import { Checkbox } from './components/Checkbox'; import { InlineDemo } from './components/Inline'; import './App.css'; // Add 'mdi-light:presentation-play' as 'demo' addIcon('demo', presentationPlay); // Add custom icon as 'experiment' addIcon('experiment2', { width: 16, height: 16, body: '', }); class CheckboxIcon extends React.Component { constructor(props) { super(); this.state = { checked: props.checked, }; this._check = this._check.bind(this); } render() { const checked = this.state.checked; const icon = checked ? checkedIcon : uncheckedIcon; const color = checked ? 'green' : 'red'; return ( ); } _check(event) { event.preventDefault(); this.setState({ checked: !this.state.checked, }); } } function App() { return (

Usage

Empty icon:
Icon referenced by name:
Icon referenced by object:
Important notice with alert icon!

Checkbox

Tests

Home icon! 24px icon in 16px text with 24px line height, aligned using inline style.

Clickable icon (testing events and style):

Colored icons (block, inline, block):

); } export default App;