svgr
two.js
svgr | two.js | |
---|---|---|
30 | 8 | |
10,324 | 8,190 | |
- | - | |
5.6 | 8.1 | |
3 days ago | about 2 months ago | |
TypeScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
svgr
-
Nx + NextJS + Docker - The Nx way: Creating the NextJS application
//@ts-check // eslint-disable-next-line @typescript-eslint/no-var-requires const { composePlugins, withNx } = require('@nx/next'); /** * @type {import('@nx/next/plugins/with-nx').WithNxOptions} **/ const nextConfig = { nx: { // Set this to true if you would like to use SVGR // See: https://github.com/gregberge/svgr svgr: false, }, }; const plugins = [ // Add more Next.js plugins to this list if needed. withNx, ]; module.exports = composePlugins(...plugins)(nextConfig);
- Easily use SVGs as JSX/TSX in your ReactJs app
- How do I use SVG icons in React?
-
SVGR for your React app
Most of the time, developers tend to add svg images to an assets directory and import them either directly or as a React component. This process not only increases your app bundle size but also makes managing all the assets difficult. What if there was a way to manage all the application icons like the way we import them from any other icon library? Yes, react-svgr helps you manage all the icons in your React application.
-
What would be the best way to implement SVG's into your project?
If you are using react, there is a tool called SVGR, which will take in an SVG file and return a react component with all the props. This can be really useful if you want to treat SVG more like a markup that will be embedded directly into your HTML. This becomes really helpful when you want to style SVG through props or add transformations and animations. Using SVG directly in markup has so many perks and advantages to the point i don't use them as source in image tags.
-
One way of building an SVG icon library for your project
Really interesting framework agnostic approach, but I think SVGR is a better option for my React homies. It imports an SVG file as a React component. Shouts also to react-icons if Font Awesome, Material Icons and friends are more your bag.
-
Alternative libs to migrate from React to Vue (or Vue to React)
SVGR
-
Power up SVGs with React and CSS
There is another way to import an SVG in Create React App, though. We can import the SVG as a ReactComponent. This is because CRA leverages SVGR to process SVGs.
-
Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ React-ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΡ ΠΈΠΊΠΎΠ½ΠΎΠΊ Ρ ΠΏΠΎΠΌΠΎΡΡΡ Figma API ΠΈ SVGR. Π§Π°ΡΡΡ 2.
const { types } = require('@babel/core'); module.exports = { ... template: function svgrCustomTemplate( { imports, interfaces, componentName, props, jsx, exports }, { tpl } ) { // ΠΌΠ΅Π½ΡΠ΅ΠΌ ΠΊΠΎΡΠ½Π΅Π²ΠΎΠΉ ΡΠ»Π΅ΠΌΠ΅Π½Ρ Π½Π° SvgIcon jsx.openingElement.name.name = 'SvgIcon'; jsx.closingElement.name.name = 'SvgIcon'; // https://github.com/gregberge/svgr/issues/530 // ΠΏΡΠΈ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΈ ΠΊΠΎΡΠ½Π΅Π²ΠΎΠ³ΠΎ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ° ΠΏΡΠΎΠΏΠ°Π΄Π°Π΅Ρ ΡΠΏΡΠ΅Π΄ ΠΏΡΠΎΠΏΡΠΎΠ² // ΠΏΠΎΡΡΠΎΠΌΡ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ ΡΠΏΡΠ΅Π΄ ΠΏΡΠΎΠΏΡΠΎΠ² ΡΠ°ΠΌΠΎΡΡΠΎΡΡΠ΅Π»ΡΠ½ΠΎ jsx.openingElement.attributes.push( types.jSXSpreadAttribute(types.identifier('props')) ); return tpl` ${imports}; import { SvgIcon } from '../SvgIcon'; ${interfaces}; const ${componentName} = (${props}) => ( ${jsx} ); ${exports}; ` } }
-
How can I export an interactive figma component to an interactive react component?
Is this an icon or icon set? Because you can absolutely change SVG icons into react components with SVGR. https://react-svgr.com/
two.js
-
Show HN: A JavaScript library for data visualization in both SVG and Canvas
> DOM-like event bubbling
This does sound very interesting. I started playing with https://two.js.org/ for a browser game but the event system proved a challange. The typescript focus also looks promising. Will give it a try.
- Ask HN: Tips to get started on my own server
-
Trying to build a front end interactive browser or app experience where touch to screen simulates a visual heat map.
Javascript touch events paired with WebGL would be the route Iβd go. There are some really great libraries for WebGL (twojs) or working with SVG (mojs) if you want to keep it simple
-
which technology or framework is used to create geometry-draggable canvas like this?
Two.js - example
- [AskJS] What is the best canvas library to make an app like figma or integromat?
-
[Showoff Saturday] My huge resources collection for web developers just hit over 500 hand-picked links! I bet you'll find *at least* one thing that improves your work day. π§°
Two.
-
[AskJS] Where are simple 2D/3D non-Geo, non-fancy libraries to be found ?!
Easel, Fabric, Konva, Mesh, P5, Paper, Pencil, Pixi, Pts, Scrawl-canvas, Three, Two.
-
Web Effect
Two.js - A renderer agnostic two-dimensional drawing api for the web with animation support.
What are some alternatives?
svg-sprite-loader - Webpack loader for creating SVG sprites.
paper.js - The Swiss Army Knife of Vector Graphics Scripting β Scriptographer ported to JavaScript and the browser, using HTML5 Canvas. Created by @lehni & @puckey
vite-plugin-svgr - Vite plugin to transform SVGs into React components
p5.js - p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs β
svgo - βοΈ Node.js tool for optimizing SVG files
svg.js - The lightweight library for manipulating and animating SVG
esbuild - An extremely fast bundler for the web
d3 - Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:
vite-plugin-svg-icons - Vite Plugin for fast creating SVG sprites.
fabric.js - Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser
raw-loader - A loader for webpack that allows importing files as a String
three.js - JavaScript 3D Library.