question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to change border radius of BottomSheetModal ?

See original GitHub issue

Ask your Question

I have read the docs and know that you style the container by using the normal style property, however when trying to change the border radius of the sheet, it does not work either with custom or default handle, I attach an example of how it looks like when using the styling prop (I added border width and color using the style prop) Uploading IMG_E0492.JPG…

IMG_E0493

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

12reactions
gorbyparkcommented, Jun 29, 2021

You need to set a custom background component using the backgroundComponent prop and set the borderRadius there.

<BottomSheet backgroundComponent={props => <BottomSheetBackground {...props} />}>

and then the BottomSheetBackground component should be something like this

const BottomSheetBackground = ({style}) => {
  return (
    <View
      style={[
        {
          backgroundColor: 'white',
          borderRadius: 12,
        },
        {...style},
      ]}
    />
  );
};
6reactions
SimpleCreationscommented, Jul 1, 2021

That works perfectly! thank you so much!, one last q, is there any way to set the custom BottomSheetBackground for ALL sheets globally ? or will I have to go one by one adding the custom background ?

You can create a custom wrapper component around BottomSheet and use it for all the sheets in your app.

// CustomBottomSheet.js
export default function CustomBottomSheet(props) {
  return (
    <BottomSheet
      backgroundComponent={props => <BottomSheetBackground {...props} />}
      {...props} />
  );
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create a modal bottomsheet with circular corners in ...
I think the best way to do a rounded-corner modal is to use a RoundedRectangleBorder with a vertical BorderRadius , setting only its...
Read more >
Bottom Sheet with Rounded Corners: 3 Steps Away [2022 ...
To make the Bottom Sheet with rounded corners, simply add the shape parameter inside the showModalBottomSheet function and assign the ...
Read more >
showmodalbottomsheet border radius - Code Grepper
1. showModalBottomSheet( ; 2. context: context, ; 3. backgroundColor: Colors.white, ; 4. shape: RoundedRectangleBorder( ; 5. borderRadius: BorderRadius.only(topLeft ...
Read more >
Custom modal with border radius - Ionic Forum
Hi guys, I am making a custom modal with a border radius so i can have rounded corners. i manage to do what...
Read more >
#bottomsheetmodal - YouTube
How to use the Ionic 6 Bottom Sheet Modal Component with React (Ionic Framework) ... Bottom sheet dialog with Rounded corners , Change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found