简体   繁体   中英

Button Material UI and React

I wanted to follow the picture below. I'm using Material-UI and React. How can I do it like that? I want to follow the grey background with little space between the white background

在此处输入图像描述

Pls check codesandbox here CLICK HERE

   <Stack spacing={2} sx={{ height: "100%" }}>
      <ToggleButtonGroup
        sx={{ alignSelf: "center", paddingTop: "12px", paddingBottom: "12px" }}
        color="primary"
        value={alignment}
        exclusive
        onChange={handleChange}
      >
        <ToggleButton value="myBrands">My Brands</ToggleButton>
        <ToggleButton value="allBrands">All Brands</ToggleButton>
      </ToggleButtonGroup>
    </Stack>

Please take look into sandbox - https://codesandbox.io/s/togglebuttonsmultiple-material-demo-forked-81uom?file=/demo.js

Given 90% solution, please change colors.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM