callstack / callstack/react-native-paper

RadioButton.Item / Checkbox.Item additional props for <Text> element

Open
#4,508 0 comments 0 reactions 0 assignees View on GitHub
Checkbox feature request RadioButton
Dominant language
TypeScript
Stars
14.5k
Forks
2.2k
Avg merge
5d 23h
Merged PRs (30d)
12

Description

Version: `5.11.0`

When using the RadioButton.Item and Checkbox.Item components, I cannot find a way to pass through props for the underlying component used for the labels, such as `adjustsFontSizeToFit`, `allowFontScaling` and `numberOfLines`.

This make it difficult to cater for longer label names, especially when dealing with different device sizes and OS text scaling options in Android. At present they are simply cut off, without any indication that the text continues.

Implementation options could include:

1. Provide a `labelTextProps` prop, which would allow passing through props to the component, similar to the way `labelStyle` is offered to pass through additional styles
2. Allow the current `label` prop to be either a string or a ReactNode so that users can override the implementation with something of their own creation

Contributor guide

Open the contributing guide

Research direction

Start at the RadioButton.Item and Checkbox.Item component entry points and inspect how their label and labelStyle props reach the underlying Text element. Compare both implementations, then verify that the requested text props or custom label rendering work for longer labels and text scaling without breaking existing usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
frontend, mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.