|
62 | 62 |
|
63 | 63 | ## Properties
|
64 | 64 |
|
65 |
| -| Prop | Type | Description | Default | |
66 |
| -| ----------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | |
67 |
| -| `id` | `string` | id associated with the number input. | | |
68 |
| -| `label` | `React.ReactNode` | Label shown above the number input. | | |
69 |
| -| `description` | `string` | Text shown above the number input but below the label; gives more details about the requirements for the input. | | |
70 |
| -| `value` | `string` | The controlled value of the number input. | | |
71 |
| -| `disabled` | `boolean` | Disables the component. | `false` | |
72 |
| -| `placeholder` | `string` | The placeholder text shown in the input field before the user begins typing. | | |
73 |
| -| `size` | `'xsmall'` \| `'small'` \| `'default'` \| `'large'` | Determines the size of the input. | `default` | |
74 |
| -| `state` | `'none'`\| `'error'` | Describes the state of the TextInput element before and after the input has been validated | `'none'` | |
75 |
| -| `errorMessage` | `string` | Error message that appears below the input. Renders only if `state='error'`. | `'This input needs your attention'` | |
76 |
| -| `successMessage` | `string` | Success message that appears below the input. Renders only if `state='valid'`. | `'Success'` | |
77 |
| -| `unit` | `string` | The string unit that appears to the right of the input if using a single unit. </br> </br>Required if using `unitOptions`. When using `unitOptions` this value becomes the controlled value of the select input. | `default` | |
78 |
| -| `unitOptions` | `Array<{displayName: string; value: string}>` | The options that appear in the select element attached to the right of the input. | `default` | |
79 |
| -| `onChange` | `(e: React.ChangeEvent<HTMLInputElement>) => void` | The event handler function for the 'onchange' event. Accepts the change event object as its argument and returns nothing. | |
80 |
| -| `onBlur` | `(e: React.ChangeEvent<HTMLInputElement>) => void` | The event handler function for the 'onblur' event. Accepts the focus event object as its argument and returns nothing. | | |
81 |
| -| `onSelectChange` | `(unit: {displayName: string; value: string}) => void` | A change handler triggered when the unit is changed. | |
82 |
| -| `className` | `string` | ClassName for the component. | | |
83 |
| -| `inputClassName` | `string` | ClassName for the input component. | | |
84 |
| -| `selectClassName` | `string` | ClassName for the select component. | | |
85 |
| -| `darkMode` | `boolean` | Render the component in dark mode. | `false` | |
86 |
| -| ... | native `input` attributes | Any other props will be spread on the root `input` element | | |
| 65 | +| Prop | Type | Description | Default | |
| 66 | +| ----------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | |
| 67 | +| `id` | `string` | id associated with the number input. | | |
| 68 | +| `label` | `React.ReactNode` | Label shown above the number input. | | |
| 69 | +| `description` | `string` | Text shown above the number input but below the label; gives more details about the requirements for the input. | | |
| 70 | +| `value` | `string` | The controlled value of the number input. | | |
| 71 | +| `disabled` | `boolean` | Disables the component. | `false` | |
| 72 | +| `placeholder` | `string` | The placeholder text shown in the input field before the user begins typing. | | |
| 73 | +| `size` | `'xsmall'` \| `'small'` \| `'default'` \| `'large'` | Determines the size of the input. | `default` | |
| 74 | +| `state` | `'none'`\| `'error'` | Describes the state of the TextInput element before and after the input has been validated | `'none'` | |
| 75 | +| `errorMessage` | `string` | Error message that appears below the input. Renders only if `state='error'`. | `'This input needs your attention'` | |
| 76 | +| `successMessage` | `string` | Success message that appears below the input. Renders only if `state='valid'`. | `'Success'` | |
| 77 | +| `unit` | `React.ReactNode` \| `string` | The content that appears to the right of the input if using a single unit. </br> </br>Required if using `unitOptions`. When using `unitOptions` this value becomes the controlled value of the select input. | `default` | |
| 78 | +| `unitOptions` | `Array<{displayName: string; value: string}>` | The options that appear in the select element attached to the right of the input. | `default` | |
| 79 | +| `onChange` | `(e: React.ChangeEvent<HTMLInputElement>) => void` | The event handler function for the 'onchange' event. Accepts the change event object as its argument and returns nothing. | |
| 80 | +| `onBlur` | `(e: React.ChangeEvent<HTMLInputElement>) => void` | The event handler function for the 'onblur' event. Accepts the focus event object as its argument and returns nothing. | | |
| 81 | +| `onSelectChange` | `(unit: {displayName: string; value: string}) => void` | A change handler triggered when the unit is changed. | |
| 82 | +| `className` | `string` | ClassName for the component. | | |
| 83 | +| `inputClassName` | `string` | ClassName for the input component. | | |
| 84 | +| `selectClassName` | `string` | ClassName for the select component. | | |
| 85 | +| `darkMode` | `boolean` | Render the component in dark mode. | `false` | |
| 86 | +| ... | native `input` attributes | Any other props will be spread on the root `input` element | | |
0 commit comments