We can use it to add a smaller carousel or more compact stepper. Material UI is a Material Design library made for React. It’s a set of React components that have Material Design styles. In this article, we’ll look at how to add mobile steppers with Material UI.
Material UI is a Material Design library made for React.
It’s a set of React components that have Material Design styles.
In this article, we’ll look at how to add mobile steppers with Material UI.
We can create a mobile stepper with the MobileStepper
component.
For instance, we can write:
import React from "react";
import MobileStepper from "@material-ui/core/MobileStepper";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";
import Paper from "@material-ui/core/Paper";
import KeyboardArrowRight from "@material-ui/icons/KeyboardArrowRight";
import KeyboardArrowLeft from "@material-ui/icons/KeyboardArrowLeft";
const steps = [
{
label: "cat 1",
imgPath: "http://placekitten.com/200/200"
},
{
label: "cat 2",
imgPath: "http://placekitten.com/199/199"
},
{
label: "cat 3",
imgPath: "http://placekitten.com/201/201"
}
];
export default function App() {
const [activeStep, setActiveStep] = React.useState(0);
const maxSteps = steps.length;
const handleNext = () => {
setActiveStep(prevActiveStep => prevActiveStep + 1);
};
const handleBack = () => {
setActiveStep(prevActiveStep => prevActiveStep - 1);
};
return (
<div>
<Paper square elevation={0}>
<Typography>{steps[activeStep].label}</Typography>
</Paper>
<img src={steps[activeStep].imgPath} alt={steps[activeStep].label} />
<MobileStepper
steps={maxSteps}
position="static"
variant="text"
activeStep={activeStep}
nextButton={
<Button
size="small"
onClick={handleNext}
disabled={activeStep === maxSteps - 1}
>
Next
<KeyboardArrowRight />
</Button>
}
backButton={
<Button size="small" onClick={handleBack} disabled={activeStep === 0}>
<KeyboardArrowLeft />
Back
</Button>
}
/>
</div>
);
}
technology javascript web-development programming software-development
To make the most out of the benefits of offshore software development, you should understand the crucial factors that affect offshore development.
Software Developer vs Web Developer | Difference Web Developer & Software Developer | Software development and web development are normally used interchangeably. Although both include development, a software developer has different responsibilities from that of a web developer.
Vinew Technologies focused majorly over ERP Software services and POS Software services, Web & Application development services & Woo commerce and Wordpress easy-to-use, multipurpose social media plugin for WordPress.
Check out these five criteria for the selection of your software vendor, and you will never regret having the wrong quality product made for you.
Mobiweb Technologies is a prestigious IT company headquartered in Indore providing promising and cost effective software and web development services across the globe.