@salesforce/design-system-react
Version:
Salesforce Lightning Design System for React
53 lines (48 loc) • 1.3 kB
JSX
import React from 'react';
import IconSettings from '~/components/icon-settings';
import Icon from '~/components/icon'; // `~` is replaced with design-system-react at runtime
class Example extends React.Component {
static displayName = 'IconExample';
render() {
return (
<IconSettings iconPath="/assets/icons">
<div className="slds-grid slds-grid_pull-padded slds-grid_vertical-align-center">
<div className="slds-col_padded">
<Icon
assistiveText={{ label: 'Warning' }}
category="utility"
color="warning"
name="warning"
size="x-small"
/>
</div>
<div className="slds-col_padded">
<Icon
assistiveText={{ label: 'Case' }}
category="standard"
name="case"
size="small"
/>
</div>
<div className="slds-col_padded">
<Icon
assistiveText={{ label: 'Case' }}
category="standard"
name="case"
size="medium"
/>
</div>
<div className="slds-col_padded">
<Icon
assistiveText={{ label: 'Case' }}
category="standard"
name="case"
size="large"
/>
</div>
</div>
</IconSettings>
);
}
}
export default Example; // export is replaced with `ReactDOM.render(<Example />, mountNode);` at runtime