Skip to main content
100%

Make a face with React

✓ Published1🌍 Public
AAlark Joshi
Last edited May 21, 2020
Created on May 19, 2020
Forked from Hello HTML

A grid of 18 randomly varied smiley faces demonstrates reusable SVG components built with React and D3. Each face is composed of a yellow background circle, two black eyes, and a mouth arc rendered using d3.arc, with positions and sizes derived from randomized props like eyeOffsetX, eyeRadius, and mouthWidth. The Face component composes smaller subcomponents—BackGroundCircle, Eyes, and Mouth—inside a FaceContainer that handles SVG width, height, and center translation. D3's range function generates the array of faces, and ReactDOM renders the entire set into a single SVG via index.js.

AI-generated description

Smiley face implementation with React.

MIT Licensed

Similar vizzes