[MUI] LAYOUT

jplendorยท2022๋…„ 8์›” 12์ผ
0

๐Ÿ‘ฉโ€๐Ÿ’ป ๋‹ฌ๋ ฅ ์ปดํฌ๋„ŒํŠธ ๋งŒ๋“ค๋‹ค๊ฐ€ ๊ณต๋ถ€ํ•˜๊ฒŒ ๋œ MUI LAYOUT~

MUI์˜ Componets ์นดํ…Œ๊ณ ๋ฆฌ ์‚ดํŽด๋ณด๊ธฐ

MUI์˜ Componets๋Š” ํฌ๊ฒŒ 7๊ฐ€์ง€์˜ ์นดํ…Œ๊ณ ๋ฆฌ๋กœ ์ด๋ฃจ์–ด์ ธ์žˆ๋‹ค!

  • INPUTS
  • DATA DISPLAY
  • FEEDBACK
  • SURFACES
  • NAVIGATION
  • LAYOUT
  • UTILS

๊ทธ ์ค‘์— LAYOUT ์นดํ…Œ๊ณ ๋ฆฌ ์‚ดํŽด๋ณด๊ธฐ

LAYOUT ์นดํ…Œ๊ณ ๋ฆฌ์—๋Š” ๋ญ๊ฐ€ ์žˆ๋ƒ๋ฉด~

  • Box

    • The Box component serves as a wrapper component for most of the CSS utility needs.
    • Box๋Š” ๋Œ€๋ถ€๋ถ„์˜ CSS ์œ ํ‹ธ๋ฆฌํ‹ฐ ์š”๊ตฌ ์‚ฌํ•ญ์— ๋Œ€ํ•œ ๋ž˜ํผ ๊ตฌ์„ฑ ์š”์†Œ ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.
      (ํ•ด๋‹น ์„ค๋ช…์€ MUI v4์—์„œ ์ž‘์„ฑ๋œ ๊ฒƒ์œผ๋กœ, MUI v5์—์„œ๋Š” ๋ชจ๋“  MUI Components์— ๋Œ€ํ•ด CSS ์Šคํƒ€์ผ์„ ์ •์˜ํ•  ์ˆ˜ ์žˆ๋‹ค. sx prop์„ ํ†ตํ•ด)
  • Container

    • The container centers your content horizontally. It's the most basic layout element.
    • Container๋Š” ์ฝ˜ํ…์ธ ๋ฅผ ๊ฐ€๋กœ๋กœ ์ค‘์•™์— ๋ฐฐ์น˜ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ€์žฅ ๊ธฐ๋ณธ์ ์ธ ๋ ˆ์ด์•„์›ƒ ์š”์†Œ์ž…๋‹ˆ๋‹ค.
  • Grid

    • The Material Design responsive layout grid adapts to screen size and orientation, ensuring consistency across layouts.
    • ๋จธํ‹ฐ๋ฆฌ์–ผ ๋””์ž์ธ ๋ฐ˜์‘ํ˜• ๋ ˆ์ด์•„์›ƒ ๊ทธ๋ฆฌ๋“œ๋Š” ํ™”๋ฉด ํฌ๊ธฐ์™€ ๋ฐฉํ–ฅ์— ๋งž๊ฒŒ ์กฐ์ •๋˜์–ด ๋ ˆ์ด์•„์›ƒ ์ „์ฒด์—์„œ ์ผ๊ด€์„ฑ์„ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค.
  • Stack

    • The Stack component manages layout of immediate children along the vertical or horizontal axis with optional spacing and/or dividers between each child.
    • Stack ๊ตฌ์„ฑ ์š”์†Œ๋Š” ๊ฐ ์ž์‹ ์‚ฌ์ด์— ์„ ํƒ์  ๊ฐ„๊ฒฉ ๋ฐ/๋˜๋Š” ๊ตฌ๋ถ„์„ ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ˆ˜์ง ๋˜๋Š” ์ˆ˜ํ‰ ์ถ•์„ ๋”ฐ๋ผ ์ง๊ณ„ ์ž์‹์˜ ๋ ˆ์ด์•„์›ƒ์„ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
  • Image list

    • Image lists display a collection of images in an organized grid.
    • ์ด๋ฏธ์ง€ ๋ชฉ๋ก์€ ์กฐ์งํ™”๋œ ๊ทธ๋ฆฌ๋“œ์— ์ด๋ฏธ์ง€ ๋ชจ์Œ์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

Box vs. Container ๋ญ๊ฐ€ ๋‹ค๋ฅด์ง€?

Box ์‚ฌ์šฉํ•œ ๊ฒฝ์šฐ

<Box>ํ…Œ์ŠคํŠธ</Box>

html ํŒŒ์ผ์—์„œ ๐Ÿ”ป

<div class="MuiBox-root css-0">ํ…Œ์ŠคํŠธ</div>

ํ™”๋ฉด์—์„œ ๐Ÿ”ป

Container ์‚ฌ์šฉํ•œ ๊ฒฝ์šฐ

<Container>ํ…Œ์ŠคํŠธ</Container>

html ํŒŒ์ผ์—์„œ ๐Ÿ”ป

<div class="MuiContainer-root MuiContainer-maxWidthLg css-1oqqzyl-MuiContainer-root">ํ…Œ์ŠคํŠธ</div>

ํ™”๋ฉด์—์„œ ๐Ÿ”ป

์š”์•ฝํ•˜์ž๋ฉด...

  • html ํŒŒ์ผ์—์„œ ํ™•์ธํ•ด๋ณด๋ฉด ๋‘˜ ๋‹ค <div>๋กœ ๋ฐ”๋€๋‹ค.
  • ํ™”๋ฉด์—์„œ ๋ณด๋ฉด Container๋ฅผ ์‚ฌ์šฉํ–ˆ์„ ๋•Œ๋Š”, ์ขŒ์šฐ ์—ฌ๋ฐฑ์ด ์žˆ๋‹ค.
  • ๊ณ„์‚ฐ๋œ CSS๋ฅผ ํ™•์ธํ•ด๋ณด๋‹ˆ ์ €๋ ‡๊ฒŒ 4๊ฐ€์ง€๋งŒ ๋‹ค๋ฅด๋‹ค. (์ขŒ) Box, (์šฐ) Container

  • Container์—๋Š” ๋‘๊ฐ€์ง€๊ฐ€ ์žˆ๋‹ค.
    • ๋ทฐํฌํŠธ ํฌ๊ธฐ์— ๋”ฐ๋ผ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ํฌ๊ธฐ๊ฐ€ ์กฐ์ •๋˜๋Š” Fluid Container (๊ธฐ๋ณธ)
      <Container>
    • ๋ทฐํฌํŠธ ํฌ๊ธฐ๊ฐ€ ๋ฐ”๋€” ๋•Œ Breakpoint๋งˆ๋‹ค ๋Š๊ธฐ๋ฉด์„œ ํฌ๊ธฐ๊ฐ€ ์กฐ์ •๋˜๋Š” Fixed Container
       <Container fixed>
      ๐Ÿ’ฌ breakpoint: xl(1536px), lg(1200px), md(900px), sm(600px), xs(0px)
profile
๋งŒ๋“ค๊ธฐ๋Š” ์žฌ๋ฐŒ์–ด!

0๊ฐœ์˜ ๋Œ“๊ธ€