Skip to main content
100%

Shapes with SVG and CSS

✓ Published0🌍 Public
SScott
Last edited Mar 17, 2020
Created on Mar 17, 2020
Forked from React Starter

This example shows how SVG shapes can be styled and composed using React, with circles and rectangles rendered in three variations. The code uses React 16.10 to create SVG elements directly in JSX, including circles with default black fills and rectangles, followed by colored versions using red and green fill attributes. A third group applies a transform translation to reposition a red circle and green rectangle together. The rendering approach relies on ReactDOM to mount the SVG component inside a 960x500 canvas, demonstrating basic vector shape placement and CSS-independent styling through SVG presentation attributes.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes