Skip to main content
Public

Share visualization

Loading preview…

Shapes with SVG and CSS

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Shapes with SVG and CSS

1
SShweta-tech
Last edited Jan 4, 2020
Created on Jan 4, 2020

This example shows how to create and style geometric shapes using raw SVG and CSS within a React application. It demonstrates drawing multiple polygons, a line, and a path, with attributes and styles applied both inline and via a separate stylesheet. The code utilizes SVG elements like `<polygon>`, `<line>`, and `<path>`, and uses a `<g>` transform to translate a group of shapes. The CSS file defines a `.lines` class, applying stroke properties and rounding the path's line joins.

AI-generated description

A bare minimum HTML page.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed