BottomSheet
화면 하단에서 위로 슬라이드하며 나타나는 모달 인터페이스입니다. 제스처로 드래그하여 닫을 수 있으며, 키보드가 나타나면 자동으로 위치를 조정합니다.
기본 사용법
import { useOverlay } from '@0610studio/zs-ui';
function MyComponent() {
const { showBottomSheet } = useOverlay();
const handleOpenBottomSheet = () => {
showBottomSheet({
component: <MyBottomSheetContent />,
options: {
height: 300,
padding: 20,
},
});
};
return <Button title="BottomSheet 열기" onPress={handleOpenBottomSheet} />;
}
API 참조
showBottomSheet 함수
showBottomSheet(props: ShowBottomSheetProps): void
ShowBottomSheetProps 인터페이스
| Prop | Type | Default | Description |
|---|---|---|---|
component | React.ReactNode | Required | Bottom Sheet 내부에 표시할 컴포넌트 |
headerComponent | React.ReactNode | undefined | 상단에 표시할 헤더 컴포넌트 |
options | BottomSheetOptions | {} | Bottom Sheet 옵션 |