GeekyAnts / NativeBase

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.
https://nativebase.io/
MIT License
20.19k stars 2.38k forks source link

Add back in ability to customize top-level box of Radio component #4438

Open kylegwalsh opened 2 years ago

kylegwalsh commented 2 years ago

Is your feature request related to a problem? Please describe. Radios used to allow us to style the outermost box of the radio, but now it looks like it only accepts {...layoutProps}. This has made us unable to use the same styles we had before upgrading (and I don't see any way to apply styles on the new Radio to achieve the same effect).

For example, we previously styled Radios like this: image

Now they are stuck looking like this: image

Describe the solution you'd like I believe the simplest way to solve the issue while keeping with the current style paradigm would be to add a new sub-style for the outermost box (similar to how there is already a _radio [which seems like it was deprecated] and _interactionBox style group). I've encountered this same limitation on a few other components as well (like on the Checkbox component).

Describe alternatives you've considered I've considered trying to hack the component to make it work by applying a "position: relative" layoutProp to the top-level box and then applying "position: absolute" to the Center child component, but this isn't possible because all layoutProps get applied to the top-level Box only.

I've also considered creating my own wrapper or rolling an entirely custom Radio component, but I'm trying to avoid it.

surajahmed commented 2 years ago

Hi @kylegwalsh, thanks for reporting this issue. We'll look into this.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.