@cloudflare/component-icon
Cloudflare Icon Component
Installation
Installation with yarn is recommended
$ yarn add @cloudflare/component-icon
Usage
import React from 'react';
import { Icon } from '@cloudflare/component-icon';
import { createComponent } from '@cloudflare/style-container';
const ColorWrapper = createComponent(
() => ({
backgroundColor: '#f1f1f1',
paddingTop: '10px',
paddingBottom: '10px',
paddingLeft: '15px',
maxWidth: 750,
display: 'block'
}),
'span'
);
ColorWrapper.setDisplayName('ColorWrapper');
const TextWrapper = createComponent(
() => ({
paddingRight: '20px',
paddingLeft: '5px'
}),
'span'
);
TextWrapper.setDisplayName('TextWrapper');
const IconComponent = () => (
<div>
<p>Types:</p>
<p>
<Icon label="caret-down" type="caret-down" />
<Icon label="caret-left" type="caret-left" />
<Icon label="caret-right" type="caret-right" />
<Icon label="caret-up" type="caret-up" />
<Icon label="resize-horizontal" type="resize-horizontal" />
<Icon label="reorder" type="reorder" />
<Icon label="forward" type="forward" />
<Icon label="backward" type="backward" />
<Icon label="left" type="left" />
<Icon label="right" type="right" />
<Icon label="collapse" type="collapse" />
<Icon label="edgeworker" type="edgeworker" />
<Icon label="expand" type="expand" />
<Icon label="retarget" type="retarget" />
<Icon label="linkedin" type="linkedin" />
<Icon label="twitter" type="twitter" />
<Icon label="google-plus" type="google-plus" />
<Icon label="facebook" type="facebook" />
<Icon label="filter" type="filter" />
<Icon label="calendar" type="calendar" />
<Icon label="file" type="file" />
<Icon label="clipboard" type="clipboard" />
<Icon label="drive" type="drive" />
<Icon label="speech" type="speech" />
<Icon label="flowchart" type="flowchart" />
<Icon label="flowchart-alt" type="flowchart-alt" />
<Icon label="hamburger" type="hamburger" />
<Icon label="list" type="list" />
<Icon label="gear" type="gear" />
<Icon label="chart" type="chart" />
<Icon label="help" type="help" />
<Icon label="info-sign" type="info-sign" />
<Icon label="ok-sign" type="ok-sign" />
<Icon label="exclamation-sign" type="exclamation-sign" />
<Icon label="refresh" type="refresh" />
<Icon label="time" type="time" />
<Icon label="sad" type="sad" />
<Icon label="happy" type="happy" />
<Icon label="minus" type="minus" />
<Icon label="ok" type="ok" />
<Icon label="pause" type="pause" />
<Icon label="plus" type="plus" />
<Icon label="remove" type="remove" />
<Icon label="search" type="search" />
<Icon label="lock" type="lock" />
<Icon label="shield" type="shield" />
<Icon label="spectrum" type="spectrum" />
<Icon label="upload" type="upload" />
<Icon label="wrench" type="wrench" />
<Icon label="bolt" type="bolt" />
<Icon label="user" type="user" />
<Icon label="stream" type="stream" />
</p>
<p>Sizes:</p>
<p>
<Icon label="2x" size="2x" type="gear" />
<TextWrapper>2x</TextWrapper>
<Icon label="2.5x" size="2.5x" type="gear" />
<TextWrapper>2.5x</TextWrapper>
<Icon label="3x" size="3x" type="gear" />
<TextWrapper>3x</TextWrapper>
<Icon label="3.5x" size="3.5x" type="gear" />
<TextWrapper>3.5x</TextWrapper>
<Icon label="4x" size="4x" type="gear" />
<TextWrapper>4x</TextWrapper>
</p>
<p>Colors:</p>
<p>
<ColorWrapper>
<Icon label="default" size="2x" type="search" color="default" />
<TextWrapper>Default</TextWrapper>
<Icon label="primary" size="2x" type="caret-right" color="primary" />
<TextWrapper>Primary</TextWrapper>
<Icon label="success" size="2x" type="ok" color="success" />
<TextWrapper>Success</TextWrapper>
<Icon label="warning" size="2x" type="info-sign" color="warning" />
<TextWrapper>Warning</TextWrapper>
<Icon label="danger" size="2x" type="exclamation-sign" color="danger" />
<TextWrapper>Danger</TextWrapper>
<Icon label="black" size="2x" type="remove" color="black" />
<TextWrapper>Black</TextWrapper>
<Icon label="white" size="2x" type="shield" color="white" />
<TextWrapper>White</TextWrapper>
</ColorWrapper>
</p>
</div>
);
export default IconComponent;