Skip to main content
100%

Shapes with SVG and CSS

✓ Published0🌍 Public
Yyann-toullec
Last edited Oct 19, 2020
Created on Oct 19, 2020
Forked from HTML Starter

This example demonstrates how to create basic SVG shapes—circles, rectangles, lines, and paths—using React and SVG elements within a simple HTML page. It shows how CSS classes control stroke styling, while SVG attributes like `fill` and `stroke-width` set individual shape colors directly. The visualization also uses `<g>` groups to apply shared styling and transformations, such as translating shapes and applying a uniform fill and stroke. The code relies on standard SVG APIs and CSS, with no external JavaScript libraries beyond React for rendering.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes