https://mui.com/system/display/
Display - MUI System
Quickly and responsively toggle the display value of components and more with the display utilities. Includes support for some of the more common values, as well as some extras for controlling display when printing.
mui.com
์ ๋ชฉ ์ฐ๊ณ ๋์ ๋ณด๋, ๋ง์ ํ๋ค ๋ง ๊ฒ ๊ฐ์์ ์ข ์๊ธฐ๋ค. (๋ง์ ๋ ๋ค.)
์์ ๊ฐ์ ์์ผ๋ก!! ์ผ์ ๊ธธ์ด๋ฅผ ๋์ผ๋ฉด ... ์ผ๋ก ์๋ต ๋๋ ๊ฑธ ๋ง์ด ๋ณด์ จ์ ๊ฑฐ์์!
์ด๊ฑธ ๊ตฌํํ ๊ฒ์!
00. Text overflow : "ellipsis", overflow : "hidden"
์์๋ก, width๊ฐ 200px์ธ Box ์์ ์ผ์ ๊ธธ์ด ๋์ด๊ฐ๋ฉด ์๋ต ๋๋๋ก ํ์ต๋๋ค.
import { Box, Typography } from "@mui/material";
...
<Box
sx={{
width: "200px",
whiteSpace: "nowrap",
bgcolor: "grey.500"
}}
>
<Typography
sx={{
textOverflow: "ellipsis",
overflow: "hidden"
}}
variant="h3"
>
Lorem Ipsum is simply dummy text
</Typography>
</Box>
์์ ์์์ฒ๋ผ, ๊ณ ์ ๋ ๊ธธ์ด์์๋ ๋์ง๋ง ๋ฐ์ํ์ผ๋ก๋ ๊ฐ๋ฅํฉ๋๋ค!
<Box
sx={{
width: 1,
whiteSpace: "nowrap",
bgcolor: "grey.500"
}}
>
<Typography
sx={{
textOverflow: "ellipsis",
overflow: "hidden"
}}
variant="h3"
>
Lorem Ipsum is simply dummy text
</Typography>
</Box>
์ ์์ ์ฝ๋์์ width : 1 ๋ก ์์ ํ ๊ฒ์ ๋๋ค.
width : 1 ์ width : 100% ์๋ ๊ฐ์ต๋๋ค. ๐
์ง๋ผ๋ ๐๐