react-open-icon
v0.1.9
Published
React component package for rendering Open Icon assets with shared icon lookup helpers.
Readme
react-open-icon
react-open-icon exposes React icon components together with the shared Icons lookup object from the Open Icon catalog.
Install
npm install react-open-icon reactUse the client component
import { Icon, Icons } from 'react-open-icon';
export const App = () => (
<>
<Icon name={Icons.UI_SEARCH_M} />
<Icon name={Icons.WAYFINDING_CHECK_IN} title="Check in" />
</>
);Icon uses the lazy open-icon/runtime entrypoint. For server rendering, preload the icon through loadIcon() or use the static entrypoint below.
Use the static component
import { StaticIcon, Icons } from 'react-open-icon/static';
export const App = () => (
<StaticIcon name={Icons.UI_SEARCH_M} />
);Use react-open-icon/static when you need synchronous markup during SSR or static rendering.
Exports
Iconfor the lazy client/runtime pathStaticIconfromreact-open-icon/staticfor synchronous SSR/static outputIcons- the shared
open-icon/runtimehelpers from the root entrypoint - the shared
open-icon/statichelpers fromreact-open-icon/static
