
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@rn-common/bottom-sheet
Advanced tools
@rn-common/bottom-sheet
The BottomSheet
component is a reusable React Native component that provides a modal bottom sheet UI by using react-native-reanimated. It includes a provider, registration method for custom bottom sheets, and methods to show and hide sheets.
Install using:
npx expo install @rn-common/bottom-sheet react-native-reanimated
Wrap your app or a section of your app with the Provider
component to enable bottom sheet functionality.
import BottomSheet from '@rn-common/bottom-sheet'
const App = () => {
const config = {
backgroundColor: '#FFFFFF',
} // optional
return (
<BottomSheet.Provider config={config}>
{/* Your app components */}
</BottomSheet.Provider>
)
}
Register your custom bottom sheet component using the BottomSheet.register
method.
const CustomBottomSheet = ({ data, close }) => {
return <View>{/* Custom content */}</View>
}
BottomSheet.register('customSheet', CustomBottomSheet)
To display a bottom sheet, use the BottomSheet.show
method.
BottomSheet.show(
'customSheet',
{ someData: 'value' },
{ backgroundColor: '#FF0000' }, // this will override the provider's config
)
To hide a bottom sheet, use the BottomSheet.hide
method.
BottomSheet.hide('customSheet')
or use the close
function provided in the custom bottom sheet component.:
const CustomBottomSheet = ({
data,
close,
type,
}: SheetProps<{ someData: string }>) => {
return (
<View>
{/* Custom content */}
<Button title="Close" onPress={close} />
</View>
)
}
type
: A string indicating the type of the bottom sheet.data
: Data passed when showing the bottom sheet.close
: A function to close the bottom sheet.FAQs
## Overview
We found that @rn-common/bottom-sheet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.