GeekyAnts / GeekyAnts/NativeBase

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

Open
#4,438 3 comments 2 reactions 0 assignees View on GitHub
v3
Dominant language
TypeScript
Stars
20.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**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](https://user-images.githubusercontent.com/15202930/147129181-40b4592e-4ff6-4636-9fc1-07f109dc26b7.png)

Now they are stuck looking like this:
![image](https://user-images.githubusercontent.com/15202930/147129224-fe7c2c41-5071-4a70-8d3f-38581ff66109.png)

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.