V99BottomSheet¶
A persistent bottom sheet shows information that supplements the primary content of the app.
I. Props¶
Name | Type | Default | Description |
---|---|---|---|
title | string | - | Header title of bottom sheet |
snapPoints | (`${number}%` | number)[] | ['50%'] | Set height BottomSheet relative to device height in percent or pixel ratio |
children | React.ReactNode | - | Add children content into BottomSheet |
backdropBehavior | BackdropPressBehavior | 'close' | Callback when user press backdrop |
usePortal | boolean | true | Use portal for container of BottomSheet |
useBackHandler | boolean | true | Enable handling when the back button is pressed on the device |
pattern | 'default' | 'search' | 'hButton' | 'vButton' | default | pattern of bottom sheet |
index | number | -1 | Initial snap index. You also could provide -1 to initiate bottom sheet in closed state and 0 to open |
II. Usage¶
III. BottomSheet template:¶
1. Default¶
Description: * This pattern is full bottom sheet
Example¶
<V99BottomSheet
title={'Bottomsheet'}
ref={defaultRef}
snapPoints={[500]}
filledButtonTitle={'button'}
outlineButtonTitle={'button'}
pattern={'default'}>
<V99Box center backgroundColor={V99Colors.black400} fill>
<V99Text>This is content</V99Text>
</V99Box>
</V99BottomSheet>
2. hButton¶
Description: * This pattern will include Children and 2 horizontal buttons
Example¶
<V99BottomSheet
title={'Bottomsheet'}
ref={columnRef}
snapPoints={[500]}
filledButtonTitle={'Ok'}
onPressFilledButton={()=>{
console.log('On Press Ok')
}}
outlineButtonTitle={'Cancel'}
onPressOutlineButton={()=>{
console.log('On Press Cancel')
}}
pattern={'hButton'}>
<V99Box center backgroundColor={V99Colors.black400} fill>
<V99Text>This is content</V99Text>
</V99Box>
</V99BottomSheet>
3. vButton¶
Description: * This pattern will include Children and 2 vertical buttons
Example¶
<V99BottomSheet
title={'Bottomsheet'}
ref={columnRef}
snapPoints={[500]}
filledButtonTitle={'Ok'}
onPressFilledButton={()=>{
console.log('On Press Ok')
}}
outlineButtonTitle={'Cancel'}
onPressOutlineButton={()=>{
console.log('On Press Cancel')
}}
pattern={'vButton'}>
<V99Box center backgroundColor={V99Colors.black400} fill>
<V99Text>This is content</V99Text>
</V99Box>
</V99BottomSheet>
4. Search¶
Description: * This pattern will include Children and a search field
Example¶
<Observer>
{()=>
<V99BottomSheet
title={'Bottomsheet'}
ref={searchRef}
snapPoints={[500]}
filledButtonTitle={'button'}
outlineButtonTitle={'button'}
pattern={'search'}
searchPlaceHolder={'Hinted search text'}
searchValue={state.value}
onSearch={state.setValue}
>
<ContentView/>
</V99BottomSheet>
}
</Observer>