简体   繁体   中英

How to put an icon on in the corner of a Material UI button

How to put an icon in the corner of a Material UI button in react?

Now what I have is this, where the icon is right next to the title. I wish to move the icon to the lower right corner of the button... Any idea how to achieve this? Thanks!

export default function CardButton() {
    return (
        <Button
            variant="contained"
            style={{
                height: 220,
                width: 275,
                margin: '1vh',
            }}
            color="secondary"
        >
            <Typography variant="button" style={{fontSize:'24px'}}>title</Typography>
            <AddIcon/>
        </Button>
    )
}

在此处输入图像描述

Use position: absolute to position the icon.

https://stackblitz.com/edit/react-ts-a6phy9

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