rio
rio copied to clipboard
Display Required Fields, Supporting Text and Icons for `MultiLineTextInput`
Description
Currently, our MultiLineTextInput
component lacks the ability to indicate which fields are required, provide supporting text, and display leading and trailing icons. These features are crucial for enhancing user experience by guiding them through forms more effectively, ensuring they understand what information is needed, and improving the overall aesthetics and functionality of the input fields.
Design Guidline
https://m3.material.io/components/text-fields/guidelines
Proposed Solution
Required Fields Indicator:
- Add
is_required
attribute to theMultiLineTextInput
component. - When
is_required
is set toTrue
, display an asterisk (*) next to the label. - Optionally, add a
is_required_indicator
attribute to allow customization of the indicator (e.g., text, color). needs discussion
Supporting Text:
- Add
supporting_text
attribute to theMultiLineTextInput
component. - The supporting text should be displayed below the input field.
- Style the supporting text to be visually distinct but not distracting (see Design Guidline).
Leading Icon:
- Add a
leading_icon
attribute to theMultiLineTextInput
component. naming needs discussion - The
leading_icon
should be displayed inside theMultiLineTextInput
, aligned to the left. - Allow customization of the icon, which accepts an icon component or a string for the icon name.
Trailing Icon:
- Add a
trailing_icon
attribute to theMultiLineTextInput
component. naming needs discussion - The
trailing_icon
should be displayed inside theMultiLineTextInput
, aligned to the right. - Allow customization of the icon, which accepts an icon component or a string for the icon name.
Alternatives
No response
Additional Context
- Update documentation and examples for these new features.
Related Issues/Pull Requests
#104, #106