<progress>
๋ธ๋ผ์ฐ์ ๋ด์ฅ ์ปดํฌ๋ํธ <progress>๋ฅผ ์ฌ์ฉํ๋ฉด ์งํ๋ฅ ํ์๊ธฐ๋ฅผ ๋ ๋๋งํ ์ ์์ต๋๋ค.
<progress value={0.5} />๋ ํผ๋ฐ์ค
<progress>
์งํ๋ฅ ํ์๊ธฐ๋ฅผ ํ์ํ๋ ค๋ฉด ๋ธ๋ผ์ฐ์ ๋ด์ฅ ์ปดํฌ๋ํธ <progress>๋ฅผ ๋ ๋๋งํฉ๋๋ค.
<progress value={0.5} />์๋์์ ๋ ๋ง์ ์์๋ฅผ ํ์ธํ์ธ์.
Props
<progress>๋ ๋ชจ๋ ์ผ๋ฐ์ ์ธ ์๋ฆฌ๋จผํธ props๋ฅผ ์ง์ํฉ๋๋ค.
๋ํ <progress>๋ ์ด๋ฌํ props๋ฅผ ์ง์ํฉ๋๋ค.
max: ์ซ์. ์ต๋value๋ฅผ ์ง์ ํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์1์ ๋๋ค.value:0์์์ต๋์ฌ์ด์ ์ซ์ ๋๋ ๊ฒฐ์ ๋์ง ์์ ์ํ์ธ ๊ฒฝ์ฐnull์ ๋๋ค. ์๋ฃ๋ ์์ ๋ํ๋ ๋๋ค.
์ฌ์ฉ๋ฒ
์งํ๋ฅ ํ์๊ธฐ ์ ์ด
์งํ๋ฅ ํ์๊ธฐ๋ฅผ ํ์ํ๋ ค๋ฉด <progress> ์ปดํฌ๋ํธ๋ฅผ ๋ ๋๋งํฉ๋๋ค. 0์์ ์ง์ ํ ์ต๋ ๊ฐ ์ฌ์ด์ ์ซ์ value๋ฅผ ์ ๋ฌํ ์ ์์ต๋๋ค. ์ต๋๊ฐ์ ์ ๋ฌํ์ง ์์ผ๋ฉด ๊ธฐ๋ณธ์ ์ผ๋ก 1๋ก ๊ฐ์ฃผ๋ฉ๋๋ค.
์์
์ด ์งํ ์ค์ด ์๋ ๊ฒฝ์ฐ, ์งํ๋ฅ ํ์๊ธฐ๋ฅผ ๋ถํ์ ์ํ๋ก ์ค์ ํ๋ ค๋ฉด value={null}์ ์ ๋ฌํฉ๋๋ค.
export default function App() { return ( <> <progress value={0} /> <progress value={0.5} /> <progress value={0.7} /> <progress value={75} max={100} /> <progress value={1} /> <progress value={null} /> </> ); }