Skip to content

Code Style - SVG

  1. Where possible use SVG icons from Material Icons
  2. If custom icons are needed, use SVG files
  3. Always use Icon in the name of the SVG file
  4. Always use currentColor for the fill color
  5. Always change default sizes to 1em to allow for easy scaling

When using SVGs in JSX, you need to convert the SVG. JSX doesn’t support SVGs directly because JSX is using camelCase for attributes instead of kebab-case.