CSS Shape Generator
Generate CSS triangles, arrows, blobs, stars and hexagons with live preview. Border-based triangles, clip-path polygons and border-radius blobs — copy CSS and HTML instantly.
How to use
Choose a shape type
Select from Triangle, Arrow, Blob, Star or Hexagon. Each uses a different CSS technique — border trick for triangles, clip-path polygon for arrows/stars/hexagons, and border-radius for blobs.
Set dimensions and colors
Enter width and height in px, rem or %. Choose a shape color and a preview background. For triangles, width controls the base and height controls the depth (perpendicular distance from base to tip).
Configure shape parameters
Pick the direction for triangles and arrows. Adjust H/V radii per corner for blobs (or click a preset or Random). Set the number of points and inner radius for stars. Choose flat-top or pointy-top for hexagons.
Copy the generated code
Hit Copy CSS to get the complete CSS rule or Copy HTML for the div element. Paste both into your project. The CSS class name is customisable — change it in the controls before copying.
What CSS shapes are used for
Tooltips & speech bubbles
CSS triangles are the classic technique for tooltip tails. A tiny border-trick triangle positioned at the edge of a tooltip box creates a pointing indicator without any images.
Navigation arrows
CSS arrows work as prev/next indicators, carousel controls and breadcrumb separators. The clip-path arrow shape is scalable, accessible and needs no icon font.
Hero & background blobs
Organic blob shapes are widely used as decorative background elements in hero sections, feature cards and testimonial blocks — giving layouts an approachable, modern feel without SVG files.
Ratings & badges
CSS stars are used for rating systems, achievement badges and decorative graphic elements. A 5-pointed star at any size using clip-path needs no image — it's pure CSS.
Profile & icon containers
Hexagonal containers are popular for team member photos, tech skill icons and dashboard metric cards. The clean geometric shape stands out from the standard square/circle.
Sorting & dropdown cues
Tiny border-based triangles are the standard technique for sort-order indicators (▲▼) in tables, select-box dropdown arrows and accordion expand/collapse icons.
How it works
Border triangle math
For triangles, the generator sets width and height to 0, then applies three borders: two transparent (forming the sides) and one colored (forming the face). Half the width value is used for the two transparent borders; the full height becomes the visible border.
clip-path computation
Arrows, stars and hexagons are computed as polygon vertex lists. Stars use trigonometric alternation between outer and inner radii for all 2N points. Hexagon vertices are placed at 0°, 60°, 120°, 180°, 240°, 300° (or offset 30° for flat-top).
Elliptical border-radius
The blob output uses the CSS border-radius elliptical syntax: h1 h2 h3 h4 / v1 v2 v3 v4, where the four horizontal and four vertical radii control the curvature at each corner independently. All values are in % so the shape scales proportionally.
Instant live preview
All CSS values are applied as inline React styles on a real DOM element — the preview is genuinely what the browser renders. Changing any control updates the preview and the generated code simultaneously, with no re-renders or delays.
Related tools
Frequently asked questions
Quick answers about this free online tool.
