Placing a materialUI circular progress bar on top of the circular icon

I'm striving to add a circular progress bar that surrounds a circular icon with a visible space between the two elements, just as depicted in the image below. Although I successfully positioned the circular progress bar around the icon, creating adequate space between them seems to be posing a challenge. Can anyone provide guidance on achieving this?

https://i.stack.imgur.com/UcAQi.png
Desired Outcome

https://i.stack.imgur.com/DPkgb.png

Current Output

Below is my code snippet:

import * as React from 'react';
import { Grid, Paper, Box, CircularProgress, circularProgressClasses } from '@mui/material';

const MileStones = () => {
    return (
      <Box sx={{ flexGrow: 1, position: 'relative', display: 'flex', flexWrap: 'wrap', justifyContent: 'center', alignItems: 'center', pl: 2 }}>
        <Grid container spacing={1.4} sx={{ py: 4 }}>
          <Grid item xs >
            <CircularProgress size={50} sx={{ color: '#C4C4C4', position: 'absolute' }} variant="determinate" value={100} />
            <Paper sx={{ background: '#162983', width: 50, height: 50, borderRadius: '50%'}}></Paper>
          </Grid>
          <Grid item xs>
          <CircularProgress size={50} sx={{ position: 'absolute' }} variant="determinate" value={25} />
          <Paper elevation={3} sx={{ background: '#162983', width: 50, height: 50, textAlign: "center", borderRadius: '50%'}}></Paper>
          </Grid>

          // Additional grid items for the circular icons
          
        </Grid>
        .
        .
        .
        .

        </Grid>
      </Box>
    )
}

export default MileStones

Answer №1

Imagine that area as a slim circle against a blank white backdrop.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Error: The method .map is not a valid function in this context

I've decided to build a small To-Do app in order to enhance my knowledge of ReactJS and React Hooks. However, I'm facing an issue with the list.map() function that I'm using. The error message keeps saying that it's not a function, but ...

Any tips on how to personalize the loading animation for single pages using CSS and GIFs?

presentLoading(message) { this.loading = this.loadingCtrl.create({ dismissOnPageChange: false, spinner:'hide', content:`<img class="load" src="assets/dual.gif" />`, }); this.loading.present(); } Hello there! I am working with the ...

Is there a way to determine whether all fields in a schema have been populated or remain empty?

I am working with a schema that looks like this: How can I determine if all the fields in the schema have been filled or not? The front-end (React.js) includes an onboarding process where users who are logging in for the first time need to complete onboa ...

Center align the typography text

Is there a way to align text in the center using <Typography align="center"> for the footer? I am encountering issues making it work properly. How can I ensure that the text is centered? import React from "react"; import { makeSty ...

Tips for horizontally aligning an item in a flexbox only when it wraps onto a new line

In my layout, I have a container that consists of text on the left and a button on the right. The challenge I'm facing is ensuring proper alignment when they are on the same line versus when the button wraps to a new line on smaller screens. Ideally, ...

Looking to remove the gray background color when an event is selected in the Material-UI Select Component

Check out my code Here is the code for the Select Component that I've been experimenting with: View Code Here ...

Customize the CSS for a Material UI popover styling

I am currently working with a Material UI popover and attempting to apply CSS styles to it. This is the code for my popover component: import React, { memo, useCallback } from 'react'; import PropTypes from 'prop-types'; import { ...

I'm looking for a way to have an element shift in a particular direction only when two keys are pressed simultaneously

Having trouble moving a square diagonally when two keys are pressed simultaneously. Trying to create an if statement that detects both key presses at the same time and triggers the movement. However, all attempts have failed so far, leaving uncertainty abo ...

I aim to place my :after content in mobile view or lower resolutions

I have a testimonial section built with HTML and CSS. You can view the demo on JSFIDDLE HERE. In the mobile view, I am facing an issue where the ":after" content is not aligning properly or appears misplaced. I'm looking for ideas to ensure that it re ...

The lengthy email exceeds its limits

Take a look at this code snippet: <div className='mt-[3vh] flex h-1/3 min-h-fit w-[80%] min-w-[300px] flex-col content-center items-center justify-center rounded-2xl bg-white shadow-[0_0_8px_rgba(0,0,0,0.2)]'> {user?.image && ...

Issue with displaying rows in Bootstrap grid

Is there a way to display images in a row for my portfolio instead of a column? I've checked my code but can't seem to figure out what's causing them to display vertically. Any assistance would be appreciated. Below is the code snippet: < ...

What is the best way to customize bootstrap styles?

Currently, I am attempting to modify basic CSS attributes within the default theme that is included with a new ASP.NET MVC 5 application in Visual Studio 2013. Specifically, my goal is to change the background color of the navigation menu. With the help o ...

Error message: React-image-crop exceeding maximum update depth limit

Currently, I am utilizing React-image-crop to choose a specific area of an image. However, my requirement is to initially retrieve the preset crop dimensions from props in order for the cropped area to be pre-selected when the image opens. In my implementa ...

Learn how to dynamically update the URL path when a specific tab link is clicked

One challenge I'm facing on my website is with the tabbed navigation for sub sections. The current script checks the URL path and selects a specific tab from the subNav array if it exists. However, switching to another top-level page doesn't upda ...

Steps for transforming draft.js output into standard html using the draft-js-html tool

I have a requirement to enable users to edit text in six different fields by adding bold, italic, underline, and images. The data needs to be stored as plain HTML in the database and retrieved in the same format. I am currently using react-draft-wysiwyg fo ...

What could be causing this error message to appear during my Storybook build process?

Recently, I made the leap of upgrading Storybook from V6.5.9 to V7.1.0 within a dynamic Next.js project. Surprisingly, everything seemed to be working fine until I attempted to build my storybook and encountered this perplexing error: ERR! => Failed to ...

When using axios in React, the REST API endpoint seems to be unresponsive and does not return any data. However

After successfully creating a simple REST API using express and bodyParser, I noticed an issue when trying to consume it in a basic React app. The API endpoint returns the expected JSON object on a GET request made through the browser without any problems: ...

What is the best way to incorporate right side padding into a horizontal scroll?

I'm attempting to include padding on the right side of a horizontal scroll so that the last item in the scroll appears in the center of the screen. Here's what I have tried so far. While the left padding works perfectly, I'm puzzled as to w ...

Creating Mathematical Formulas in Antd React Text Fields

During my work on a project that generates various kinds of questions for users, I encountered an obstacle. <form name="dynamic_form_nest_item" hideRequiredMark form={form} onFinish={onfinish} autoComplete="off"> <Form.Item ...

Getting data from a list in an SPFX solution: A step-by-step guide

I have 3 files - RequestSHP.tsx, WebPart.ts, Exekucie.tsx. I'm attempting to populate a dropdown with data from a list, but encountering a "404 (Not Found)" error. Here is my RequestSHP.tsx -> import {sp} from '@pnp/sp/presets/all'; exp ...