SVG Basic Shapes

Definition
Basic shapes are the SVG elements you draw first: <rect>, <circle>, <ellipse>, <line>, <polygon>, <polyline>, <path>, and <text>.
After the SVG introduction, open Rectangle and Circle, then move through polygons, path, and text.
Beginner path.
Rectangle & circle → ellipse & line → polygon / polyline → path → text.
Syntax
A tiny SVG with a rectangle and a circle:
SVG
<svg viewBox="0 0 240 120" xmlns="http://www.w3.org/2000/svg">
<rect x="20" y="30" width="90" height="60" rx="8" fill="#2563eb"/>
<circle cx="175" cy="60" r="35" fill="#16a34a"/>
</svg> Topics
Guides in the Basic Shapes section (8 tutorials).
Primitive shapes
4 topicsFast shapes with a few attributes — start here.
Polygons, paths & text
4 topicsMulti-point outlines, freeform paths, and labels.
Try it
Live Preview
Change the rectangle corner radius and circle radius — the same attributes as the topic pages.
How to Learn Basic Shapes
A practical order for this hub:
- Read the SVG introduction and set a
viewBox. - Draw a filled
rect, then acircle. - Try
ellipseandlinewith stroke. - Build a star or arrow with
polygon/polyline. - Learn a few
pathcommands (M, L, C, Z). - Label drawings with
text, then open Styling & Effects.
Frequently Asked Questions
The core SVG drawing elements: rectangle, circle, ellipse, line, polygon, polyline, path, and text — the building blocks for icons, diagrams, and illustrations.
Start with rectangle and circle. They need only a few attributes. Path is powerful but denser — learn it after the simpler shapes feel natural.
polygon closes back to the first point and can be filled. polyline is an open chain of segments — great for graphs and open outlines.
Strongly recommended. viewBox defines the coordinate system so shapes scale cleanly when the SVG is resized with CSS or width/height.
Yes. Style <text> with font-family, font-size, fill, and other CSS or presentation attributes — covered on the Text topic page.
This page is the index for the Basic Shapes sidebar section. Each topic page has full syntax, live demos, examples, and FAQs.
Start with SVG Rectangle
Open the rectangle guide — attributes, live preview, and examples.
8 people found this page helpful
