1.0.0 âĸ Published 4 months ago
@cognam/custom-input v1.0.0
đĻ Custom Input Component
A reusable and customizable Material-UI Input component with enhanced features like:
- â Input masking
- đĢ Custom error handling
- âšī¸ Helper text
- đ¯ Start/end adornments
- đī¸ Fully compatible with Material-UI
TextField
props
đ Installation
npm install @cognam/custom-input
đ§Š Usage
import React from 'react';
import CustomInput from '@cognam/custom-input';
function MyForm() {
return (
<CustomInput
label="Phone Number"
mask="(999) 999-9999"
error={false}
helperText="Enter your phone number"
/>
);
}
đ Props
Prop | Type | Default | Description |
---|---|---|---|
testId | string | â | Required. Used for testing libraries |
label | string or object | â | Label for the input |
mask | string | â | Input mask pattern (e.g., 999-999-9999 ) |
error | boolean | false | Error state toggle |
errorText | string | â | Error message shown below the input |
...props | any | â | All other valid Material-UI TextField props |
1.0.0
4 months ago