How to Integrate Xedia Icons into React and Figma
Overview
A step-by-step guide to add Xedia icons to a React project (component-based, npm) and to use them in Figma for design work.
React — Quick Integrations
1) Install (npm)
Assuming Xedia provides an npm package named xedia-icons:
bash
npm install xedia-icons
2) Import specific icons (tree-shaking)
jsx
import { XediaHome, XediaSearch } from ‘xedia-icons’;
3) Use as React components
jsx
function IconButton() { return <button aria-label=“search”><XediaSearch width={20} height={20} /></button>; }
4) Styling and theming
- Size: pass width/height or font-size if the icon is an inline SVG.
- Color: use fill/stroke props or CSS color on SVG (e.g.,
style={{ color: ‘#333’ }}) depending on implementation. - Accessibility: add aria-label or aria-hidden as appropriate.
5) Bundle optimization
- Import individual icons (not a whole library) to keep bundle small.
- If available, use an official icon loader or dynamic imports:
js
const Icon = React.lazy(() => import(‘xedia-icons/dist/icons/XediaSearch’));
Figma — Quick Integrations
1) Install/Import
- If Xedia provides a Figma file or plugin: open the provided Figma kit and duplicate it into your team files.
- If provided as SVGs: drag-and-drop SVG files into Figma or use “File → Place image/….svg”.
2) Use components
- Convert imported icons into Figma Components (right-click → Create Component) to reuse and maintain consistency.
- Create a Component Set (variants) for different sizes or styles.
3) Styling and scaling
- Use vector fills and strokes to change color.
- Scale vectors without loss; use Auto Layout for responsive placements.
4) Export settings
- For developers, export icons as SVG (1x) or as PNG at required resolutions.
- Set export preset: Format = SVG, Outline text if needed.
Workflow Recommendations
- Keep a single source: maintain icon components in React and a matching Figma library to ensure parity.
- Use consistent naming (e.g., xedia-home) and a versioned icon kit.
- Automate SVG optimization (SVGO) before committing assets.
- Document size tokens (e.g., icon-sm = 16px) and color tokens in both code and Figma.
Example mapping table
| Purpose | React usage | Figma action |
|---|---|---|
| Small UI icon | Component variant: 16px | |
| Colored state | style={{ color }} or prop | Change vector fill color |
| Export for web | SVG export, optimized | Export SVG from Figma |
If you want, I can generate ready-to-copy React icon component wrappers or a Figma component naming convention for your project.
Leave a Reply