npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@amrshadid/awesome-rn-bottom-sheet

v1.0.3

Published

React Native bottom sheet component for iOS + Android

Downloads

4

Readme

Awesome-rn-bottom-sheet

MIT License Build Status

Badges

Add badges from somewhere like: shields.io

MIT License Build Status

Installation

Install my-project with npm

  npm install awesome-rn-bottom-sheet

or with yarn

 yarn add awesome-rn-bottom-sheet

Usage/Examples

import { StatusBar } from  'expo-status-bar';
import  React  from  'react';
import { StyleSheet, View, Text } from  'react-native';
import  Sheet  from  'awesome-rn-bottom-sheet'

 
export  default  function  Example(){

return (
<View  style={styles.container}>
	<StatusBar  style="light"  />
	<Sheet
	initState={25}
	maxState={50}
	ShowArrow >
		<Text style={{alignSelf:"center",fontSize:25}}>
			Hello World!
		</Text>
	</Sheet>
</View>
);
}
const  styles = StyleSheet.create({
	container: {
		flex:  1,
		backgroundColor:  '#111',
		alignItems:  'center',
		justifyContent:  'center',
	}
});
import { StatusBar } from  'expo-status-bar';
import  React, {useRef} from  'react';
import { StyleSheet, TouchableOpacity,View, Image} from  'react-native';
import  Sheet,{SheetRefProps} from  '../components/sheet'

export  default  function  SnapCode(){

const  ref = useRef<SheetRefProps>(null);

const  onPress =() => {
	const  isActive = ref?.current?.isActive();
	if (isActive) {
		ref?.current?.scrollTo(0,false);
	} else {
		ref?.current?.scrollTo(40,true);
	}
};

return (

<View  style={styles.container}>

	<StatusBar  style="light"  />
	
	<TouchableOpacity  
	style={styles.button}  
	onPress={onPress}/>

	<Sheet
	ref={ref}
	initState={0}
	maxState={40}
	ShowArrow
	ArrowStyle={{
	backgroundColor:'black',
	width:20
	}}
	>
		<View  style={styles.snapCodeContainer}>
			<Image
			style={styles.image}
			source={require('../assets/code.png')}
			/>
		</View>
	</Sheet>
</View>

);
}

const  styles = StyleSheet.create({
	container: {
		flex:  1,
		backgroundColor:  '#111',
		alignItems:  'center',
		justifyContent:  'center',
	},
	button: {
		height:  50,
		borderRadius:  25,
		aspectRatio:  1,
		backgroundColor:  'white',
		opacity:  0.6,
	},
	snapCodeContainer:{
		alignSelf:"center",
		width:'50%',
		height:'100%',
		borderRadius:20,
		marginTop:10,
		shadowColor:  "#000",
		shadowOffset: {
		width:  0,
		height:  3,
		},
		shadowOpacity:  0.27,
		shadowRadius:  4.65,
		elevation:  6,
		overflow:'hidden',
	},
	image: {
		alignSelf:"center",
		width:  180,
		height:  180,
		padding:5,
		borderRadius:30,
		borderBottomLeftRadius:35,
		borderBottomRightRadius:35
	},
});

Props

|Props| Type| mandatory|Description|default| |-|-|-|-|-| | initState | number| true |The value of initial height of sheet, the value must be between 0-100| none| | maxState | number| true | The value of max height of sheet, the value must be between 0-100|none| | contentContainerStyle | ViewStyle| false|StyleSheet| bottomSheetContainer| | ArrowStyle | ViewStyle| false | StyleSheet|ArrowStyle | ShowArrow | boolean| false | true: to show arrow or false to disable arrow |true

Methods

To used this methods you should use useRef hook and pass it to Sheet component

...
	const  ref = useRef<SheetRefProps>(null);
	<Sheet
	ref={ref}
	...
	>
    
	</sheet>
...

For more details take a look to second example

|Methods|Description| |-|-| | scrollTo | ScrollTo is void function used to scroll a sheet to a specific position. The first parameter is the destination a value of which must be between 0-100, and the second parameter the active is boolean. Example: ScrollTo(50,true) | | isActive | isActive function used to return a boolean value of sheet active or not Example: ref?.current?.isActive()|

🔗 Author

Made by Amr shadid

portfolio linkedin