callstack / react-native-paper

Material Design for React Native (Android & iOS)
https://reactnativepaper.com
MIT License
12.76k stars 2.08k forks source link

Support Line Breaks in Tooltip Component Title #4072

Open bake0937 opened 1 year ago

bake0937 commented 1 year ago

Is your feature request related to a problem? Please describe. Yes, currently the Tooltip component in react-native-paper does not support line breaks within its content. This limitation makes it challenging to present information that's inherently structured in multiple lines, such as addresses or lists, leading to decreased readability.

Describe the solution you'd like I'd like the content of the Tooltip component to recognize and render newline characters (\n). Alternatively, the component could support styled content that can be formatted with line breaks.

Describe alternatives you've considered A possible alternative might be to use a custom tooltip component or another library, but it would be more beneficial and coherent to have this feature natively in react-native-paper.

Additional context Allowing line breaks in the Tooltip component would greatly enhance its versatility. As UI/UX design evolves, presenting content in a clear and readable format is essential, and this change would cater to a wider variety of use cases.

lukewalczak commented 1 year ago

Hey @bake0937, the MD documentation recommends to avoid wrapping text to the multiple lines:

image

At the same time, there is new Tooltip type called rich which can be implemented in the library:

image

I will create a feature request for new variant.

lukewalczak commented 1 year ago

Actually, documentation also presents the plain Tooltip in the multiline variant, which is kinda confusing:

image
KKA11010 commented 1 month ago

Hi @lukewalczak, is there a public branch where this feature is being developed? I'd love to track the progress or possibly contribute with a PR. Thanks a lot!