Ishadijcks / MooLite

Open source Milky Way Idle client
11 stars 4 forks source link

feat(MDS): Input component #115

Open LagunaElectric opened 1 year ago

LagunaElectric commented 1 year ago

Component: Input

Feature Request: The Input component is needed to allow users to enter text or select options from various input fields. It serves as a fundamental element for capturing user input in forms and interactive components.

Reasons for the Component:

Variations and Special Options: Regarding handling different types of input, there are two possible approaches:

  1. Single Component with Options: Create a single Input component that supports various input types and provide options to customize its behavior. This approach allows flexibility and reuse, as the same component can handle different input types (text, number, email, etc.). The options can include:

    • Input type: Specify the type of input (text, number, email, etc.) using a prop or attribute.
    • Validation: Provide options for input validation rules, such as required fields, character limits, and format restrictions.
    • Icon and Label: Include options to display icons or labels based on the input type to enhance usability.
  2. Multiple Component Approach: Create separate components for different input types. This approach offers specialized components tailored to each input type, providing more focused functionality and potentially better user experience. For example, having distinct components like TextInput, NumberInput, EmailInput, etc., each with specific features and validation rules.

Consider the specific needs of the project and the trade-offs between flexibility and specialization to determine the preferred approach.