r/reactnative • • Aug 30 '21

Bottom Sheet v4 is here 🚀

513 Upvotes

33 comments sorted by

40

u/gohom92 Aug 30 '21

A fully rewritten version to provide more stability, performance, and more features Fire

  • Improve keyboard handling.

  • Add pull-to-refresh handling.

  • Add detach sheet/modal.

  • ... and more

https://gorhom.github.io/react-native-bottom-sheet/blog/bottom-sheet-v4

5

u/XannyGambit Aug 30 '21

starting a new react native project today. will be using this, cheers!

2

u/[deleted] Sep 01 '21

Solid, thanks!

12

u/CodalReef Aug 30 '21

Awesome project! Also, a bit off topic, but I'm wondering how you made this demo video?

14

u/gohom92 Aug 30 '21

2

u/CodalReef Aug 30 '21

Very cool thank you

2

u/hello_Mrs_Cumberdale Aug 30 '21

Looks nice! Can it handle dynamic-sized content? I currently have a project that includes bottomsheets where the sizing is not known ahead of time. I've had to do some pretty hacky stuff to calculate the height and set snap points on the fly. Would love to move away from that.

2

u/JuyinSama Aug 30 '21

Thanks a lot for this amazing project 🙌🏻 Using it in each project i'm developing. Just need to understand how to handle modal's auto height according to the children height 👀

2

u/jascination Aug 31 '21

Nice one! /u/gohom92 this might go against the intention of bottom-sheet, but is it possible to move the content on the screen up in line with the bottom sheet?

My use case is a chatbot, built in react native gifted chat, with a custom composer input (so no keyboard, just radio / checkbox buttons that the user can select). Would be interested in seeing if I can use this.

1

u/gohom92 Aug 31 '21

Yes, you will need to use animatedPosition to push your content away from the sheet 👍

44

u/daybreaker Aug 30 '21

I think I am about to use the shit out of that detach sheet. That looked super nice.

6

u/KieranOsgood Aug 31 '21

Damn, agreed!

21

u/[deleted] Aug 30 '21

Wow! I've never seen a modal being advertised like that. Can't wait to see the SuperBowl ad!

5

u/[deleted] Aug 30 '21

Oh man, I can't wait! I'm using Bottom Sheet for a product that's about to launch, but the designers are going to love the new features. Might have to incorporate some in the next release. Thx!

1

u/meseeks_programmer Aug 31 '21

My biggest issue was always the bottom sheet not drawing overtop of things like react navigations bottom tab navigator. Is that fixed/different in this release?

2

u/gohom92 Aug 31 '21

You could you BottomSheetModal, and set the provider at the root component

1

u/meseeks_programmer Aug 31 '21

Thanks I'll give that a try on my next project that needs it

3

u/divadutchess iOS & Android Aug 30 '21

I've been looking for the name of this as I just started coding in react native... Thank you so much!

3

u/[deleted] Aug 30 '21

Amazing!

2

u/aungmt-tgo Aug 31 '21

Have been using v3 and was waiting for Detach Sheet :D Will update now. Thanks!

2

u/readitron Aug 31 '21

Yasss! thank you!

2

u/soupified Oct 28 '21

This looks absolutely incredible!

Quick note: the usage docs for Bottom Sheet Modal seem incomplete/incorrect. That or the types are incorrect. When using the BottomSheetModalProvider, the value prop is marked as required. The snippets shown in the docs don't show it being used at all.

1

u/Vasault Aug 31 '21

Amazing, btw does detach sheet could work like a toast from android?

1

u/AcetyldFN Aug 31 '21

Same question here.

1

u/AcetyldFN Aug 31 '21

Hey u/gohom92

So currently we are basicly doing this by using screens from react-navigation.

We put modal type as the screen type.
https://imgur.com/a/UMwJyRa

So atm we get this. And it works perfectly.

Downside is that we render it at root level as a seperate screen in the ModalRoutes.js. (Good side is that its not render unless navigated.

Because we always want it to be on top.

Can this be done with BottomSheet as well? The issue i think about is that it will always be rendered in the backend.

1

u/lovemeslowly iOS & Android Aug 31 '21

I hope the animations will be as smooth as this gif 🤞🏼

1

u/haron68 Sep 08 '21

beautiful

0

u/[deleted] Aug 30 '21

[deleted]

1

u/gohom92 Aug 30 '21

up to your implementation ! but the detach functionality could be applied to BottomSheet or BottomSheetModal