Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Openlayers
- input
- 학습법 #집중력
- Let
- boolean
- appendChild
- createtextnode
- FOR
- htmlFor
- VAR
- Append
- const
- createElement
Archives
- Today
- Total
Atomic Habits
[React] MUI - custom SVG Icon 만들기 본문
[MyIcon.jsx]
import React from 'react'
import { Icon } from "@material-ui/core";
import ICONS from '../../imgs/playbtn.svg';
// 방법1
const Logo = () => (
<Icon className="exIcon" style={{width: '100%', height: '100%', color: "red"}} >
<img src={ICONS} height={20} width={20}/>
</Icon>
);
export default Logo;
// 방법2
// const Logo = () => {
// return (
// <Icon style={{width: '100%', height: '100%', color: "red"}} >
// <img className="exIcon" src={ICONS} height={20} width={20}/>
// </Icon>
// )
// }
// export default Logo;
// 방법3
// export default function Logo() {
// return (
// <Icon style={{width: '100%', height: '100%', color: "red"}} >
// <img className="exIcon" src={ICONS} height={20} width={20}/>
// </Icon>
// )
// }
[ShowIcon.jsx]
import * as React from 'react';
import LoadingButton from '@mui/lab/LoadingButton';
import Box from '@mui/material/Box';
import FormControlLabel from '@mui/material/FormControlLabel';
import Switch from '@mui/material/Switch';
import SaveIcon from '@mui/icons-material/Save';
import starIcon from '../../imgs/star.png';
import Logo from "./MyIcon";
export default function LoadingButtonsTransitionEx() {
const [loading, setLoading] = React.useState(false);
function handleClick() {
setLoading(true);
}
return (
<Box sx={{ '& > button': { m: 1 } }}>
<LoadingButton
onClick={handleClick}
startIcon={<Logo />} ★
endIcon={<SaveIcon />} ★
loading={loading}
loadingPosition="end"
variant="contained"
>
Send
</LoadingButton>
<img src={ starIcon} alt="ddd" />
</Box>
);
}
'IT > React' 카테고리의 다른 글
리액트 부트스트랩(Bootstrap) (0) | 2021.11.18 |
---|---|
React. Part2. ch3. 13. Tailwindcss (0) | 2021.11.16 |
React. Part2. ch3. 10~12. Material UI 1,2,3 (0) | 2021.11.14 |
[VS CODE] React Code Snippets (0) | 2021.11.14 |
[checkAll] ! ! list .length ? boolean ? (0) | 2021.11.14 |
Comments