Jump to content

How to create dotted border around a circular avatar using css and/or svg just like WhatsApp


Recommended Posts

Posted

I want to replicate the exact UI that WhatsApp has for its status screen to show the count of statuses along with active and inactive contexts.

See the image for reference:

image.png.49f498d3543986edccdd0873aa2e223b.png

Posted

For SVG, you could create a path for each segment of the circle. You'd have to find the start and end coordinates of each segment, and then you'd use elliptical arc path segments:

<path d="M START_X,START_Y A RADIUS RADIUS 0 0 0 END_X,END_Y" stroke="blue" />

The example above assumes that the arc is drawn clockwise and is smaller than 180 degrees; the second and third zeroes may have to be changed to ones if either of those assumptions changes for a given arc. MDN has further details on the A path command.

  • Thanks 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...