Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Add Input Validation Error Styles to Input Component #265

Open
GustavoSmith opened this issue Jan 15, 2025 · 0 comments
Open

[REQUEST] Add Input Validation Error Styles to Input Component #265

GustavoSmith opened this issue Jan 15, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@GustavoSmith
Copy link

Feature Request: Add Input Validation Error Styles to Input Component

Summary

The current Input component lacks the visual feedback for validation errors style currently on TiendaNube, making it difficult for users to identify issues with their input. This feature request aims to enhance the user experience by adding distinct error styles to the Input component.

Image

Current Implementation

Currently, the Input component only has a "danger" appearance prop, but it's unable to be selected based on aria-invalid status or any other error on the input itself.

Expected Behavior

The Input component should:

  • Display a clear error style when validation fails (e.g., red border, error message).
  • Allow developers to customize error styles through props or CSS classes.
  • Provide an option to show/hide error messages based on validation state.

All of this, based on the current inplementation on the Tiendanube site.

Use Cases

  • Form validation where users need immediate feedback on their input.
  • User registration forms that require specific input formats.
  • Search fields that validate user input before submission.

Why This Matters

Without proper validation error styles, users may:

  • Be unaware of input errors, leading to frustration and poor user experience.
  • Submit forms with invalid data, resulting in additional error handling on the server side.
  • Experience inconsistency across different forms and applications.

Suggested Implementation

Add support for:

  • Error styles (e.g., red border, background color) that can be applied when validation fails.
  • An errorMessage prop to display relevant feedback to the user.
  • Customization options for error styles through props or CSS classes.

This enhancement would align with best practices in form validation and improve overall usability.

Additional Context

Implementing this feature will significantly enhance the Input component's usability, providing users with immediate feedback and improving the overall user experience in forms.

@GustavoSmith GustavoSmith added the enhancement New feature or request label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant