tsimport {useInputContainer} from '@astryxdesign/core/hooks'
| Guidance | Practices |
|---|---|
| Do | Use inside input wrapper components (TextInput, NumberInput, TimeInput, TextArea) to make the full container area clickable. |
| Do | Attach both onClick and onMouseUp to the wrapper div for full interaction handling. |
| Don't | Use on bare inputs without a wrapper; there is no benefit if the input already fills the full clickable area. |
| Param | Type | Description |
|---|---|---|
optionsrequired | UseInputContainerOptions | Configuration object for the input container. |
options.containerRefrequired | RefObject<HTMLElement | null> | Ref to the outer container/wrapper element. |
options.inputRefrequired | RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLElement | null> | Ref to the inner input or textarea element. |
options.disabled | boolean (default: false) | Whether the input is disabled. |
| Field | Type | Description |
|---|---|---|
| onClick | (event: MouseEvent<HTMLElement>) => void | Click handler to attach to the container wrapper. |
| onMouseUp | (event: MouseEvent<HTMLElement>) => void | Mouse up handler to attach to the container wrapper. |