Input
MYDS-compliant input component for seamless transition starting point from HTML/CSS to React
1. Overview
The Input component provides a consistent, accessible text input field that follows MYDS design guidelines. It includes multiple states for different user interactions and feedback scenarios.
2. Features
- Multiple States: Default, hover, focus, disabled, and error states
- Accessibility: Proper labels and ARIA attributes
- Dark Mode: Full dark mode support
- Responsive: Adapts to different screen sizes
- Customizable: Easy to style and extend
3. Usage
Basic Input
Input with Error
Disabled Input
4. Class Reference
| Class | Description |
|---|---|
.myds-input | Base input styling |
.myds-input-wrapper | Container for label and input |
.myds-input-label | Label styling |
.myds-input-hover | Hover state (for demos) |
.myds-input-focused | Focus state (for demos) |
.myds-input-error | Error state styling |
5. Accessibility
- Always pair inputs with labels using the
myds-input-labelclass - Use appropriate
typeattributes (text, email, password, etc.) - Include placeholder text for additional context
- Error states should be accompanied by error messages
- Disabled inputs are not focusable or interactive