Open Hiswe opened 6 years ago
I think I should be able to provide a template for generating React components.
Right now it's easy to make a component referencing the svg-symbols:
import React from 'react'; import classNames from 'classnames'; import PropTypes from 'prop-types'; const BASE_CLASS = `svg-icon` export function Icon( props ) { const { svgId, className, ...other } = props const COMP_CLASS = classNames( BASE_CLASS, `icon-${ svgId }`, className ) return ( <svg role="img" className={ COMP_CLASS } {...other} > <use xlinkHref={`#icon-${ svgId }`}></use> </svg> ) } Icon.propTypes = { svgId: PropTypes.string.isRequired, } export default Icon
But we should be able to include the whole SVG for an icon into the DOM. This will allow us to have a more granular styling.
classnames
prop-types
I think I should be able to provide a template for generating React components.
Right now it's easy to make a component referencing the svg-symbols:
But we should be able to include the whole SVG for an icon into the DOM. This will allow us to have a more granular styling.
classnames
orprop-types
)