@ichava/js-icon-components/react is the React flavour: one forwardRef component per icon.
| Import | Exports |
|---|---|
@ichava/js-icon-components/react/<pack> |
one component per icon, e.g. IconMug |
@ichava/js-icon-components/react |
Icon, createIcon, the ReactIconProps and IchavaIcon types |
import { IconMug } from '@ichava/js-icon-components/react/tabler';
<IconMug size={20} color="#7c3aed" strokeWidth={1.5} title="Coffee" className="me-2" />The ref is the <svg> element. Any SVG attribute in React spelling (onClick, style,
className) goes to the root; className is added to ichava-icon.
import { Icon, createIcon } from '@ichava/js-icon-components/react';
import { IconMug as mug } from '@ichava/js-icon-components/data/tabler';
const Mug = createIcon(mug);
<Icon icon={mug} size={16} />src/react/index.tsx. Compiled by tsc in the build and by esbuild in tests/react.test.ts,
which renders three icons with react-dom/server.