Repository navigation
Open
Description
Is your feature request related to a problem? Please describe.
We are moving our Android card form to the Compose CardFields (ui-components 5.34.0) and want it to match our design system. CardFields(controller, modifier) takes no styling parameters, and the building blocks (CardFieldBaseTextInputField, the field composables, the error row) are internal or private. The only styling route is overriding the card_field_* resources by name. That covers colors and sizes, but several parts cannot be changed at all:
- Error text color.
CardFieldErrorMessagedraws the error text withR.color.card_field_text, the same color as the typed digits. A red error message is impossible without red card digits.card_field_errorapplies only to the icon and border. - Error icon. The icon can only be replaced by overriding the
ic_card_field_errordrawable. There is no way to omit it; we ship a 1dp transparent vector to hide it. - Input typography. The
BasicTextFieldtext style sets only color and size, so the typed digits always use the system font. The hint followsLocalTextStyle, so hint and input end up in different fonts. - Field height. The CVV help
IconButton(CardCvvField.kt) has the 48dp minimum touch target. Withcard_field_min_heightbelow 48dp, the CVV field is taller than the expiration field next to it, and the error rows under them do not line up. - Floated hint overlap. The floated hint and the input are positioned independently (
card_field_hint_float_top_marginfrom the top,card_field_input_margin_bottomfrom the bottom). With a smaller min height, a long hint such as "Expiration (MM/YY)" overlaps the typed text. - Autofill and IME. The fields set no
contentType(credit card number, expiration, security code) and no IME action, so password-manager autofill and keyboard "Next" do not work.
Describe the solution you'd like.
As an app developer using the Compose CardFields, I want to style the fields from Compose so that the card form matches the rest of my app.
For example:
- A
CardFieldsStyle/CardFieldsColorsparameter onCardFields(input text style, hint text style, error text style and color, border colors and widths, shape, min height), with defaults equal to the current resource values. - An error slot, for example
errorContent: @Composable (String) -> Unit, or at least a separatecard_field_error_textcolor resource and an option to hide the icon. - Input text that respects
LocalTextStyle(or the style parameter above). - Layout where the hint and input cannot overlap at any supported min height, and where all fields in a row have the same height.
contentTypesemantics for autofill, andImeAction.Next/Donebetween the fields.
Happy to share more detail or test a snapshot build.
Metadata
Metadata
Assignees
Labels
No labels
Activity
mzlangreder commentedon Nov 9, 2026
Hi @Dwite , thank you for the feedback. We're going to get to work planning and scoping these improvements for
CardFields.