dev-wiki-kr / dev-wiki

dev-wiki 웹 서비스입니다.
https://devwiki.co.kr
4 stars 0 forks source link

feat: bottom sheet 컴포넌트 구현 #61

Closed im-na0 closed 4 months ago

im-na0 commented 4 months ago

설명

close #39 floating ui를 이용해 bottom sheet 컴포넌트를 구현합니다.

변경 내역

논의할 점

스크린샷 2024-06-16 오전 2 28 24

사용법

function DefaultBottomSheet() {
    const [open, setOpen] = useState(false) // controlled 방식
    return (
      <>
        <button onClick={() => setOpen(true)}>바텀시트 열기</button>
        <BottomSheet open={open} onOpenChange={setOpen}>
          <BottomSheetContent>
            <BottomSheetHeader>
              <BottomSheetTitle>바텀시트 제목</BottomSheetTitle>
              <BottomSheetClose />
            </BottomSheetHeader>
            <BottomSheetBody>
              <BottomSheetDescription>바텀시트 내용
              </BottomSheetDescription>
            </BottomSheetBody>
          </BottomSheetContent>
        </BottomSheet>
      </>
    )
  }

https://floating-ui.com/docs/dialog 를 참고해서 만들었습니다

스크린샷

https://github.com/dev-wiki-kr/dev-wiki/assets/139189221/8b345a64-c79f-4fba-8767-20d36f54911a

hwangstar156 commented 4 months ago

머지할게요~