@brighthr/component-input
Advanced tools
Comparing version
import React from 'react'; | ||
import { IconName } from '@brighthr/component-icon'; | ||
declare type InputProps = React.InputHTMLAttributes<HTMLInputElement> & { | ||
type InputProps = React.InputHTMLAttributes<HTMLInputElement> & { | ||
error?: boolean; | ||
@@ -6,0 +6,0 @@ inputSize?: 'base' | 'xl'; |
{ | ||
"name": "@brighthr/component-input", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"license": "MIT", | ||
@@ -23,6 +23,6 @@ "type": "module", | ||
"dependencies": { | ||
"@brighthr/component-icon": "^2.1.3", | ||
"@brighthr/component-icon": "^2.1.4", | ||
"classnames": "^2.3.1" | ||
}, | ||
"gitHead": "5ca0dcd0f44c7e270cf0618889e7ce0974fe6a53" | ||
"gitHead": "df7c45387b0f3c9eae38fd1b8e236bccab1caa6d" | ||
} |
@@ -1,17 +0,32 @@ | ||
# Input | ||
## Input | ||
## Installation | ||
To install, type the following into the command line at the root of your project: | ||
```javascript | ||
``` | ||
npm i @brighthr/component-input | ||
``` | ||
To implement the Input component into your project you’ll need to add the import: | ||
## Import | ||
```javascript | ||
import Input from '@brighthr/component-input'; | ||
``` | ||
After adding import into your project you can use it simply like: | ||
Import into your file: | ||
```jsx | ||
<Input /> | ||
``` | ||
## Props | ||
```javascript | ||
import ComponentName from '@brighthr/component-input'; | ||
``` | ||
| Name | Type | Default | Description | | ||
|-----------------|---------------------------|----------|----------------------------------------------------------------------------------| | ||
| buttonAriaLabel | `string` | | Sets the aria-label for the button if `hasOverlay` and `hasButton` are `true`. | | ||
| disabled | `boolean` | | If `true`, disables the input. | | ||
| error | `boolean` | `false` | If `true`, shows a red error theme. | | ||
| inputSize | `'base'` `'xl'` | `'base'` | Sets the size of the input. | | ||
| label | `string` | | Sets the label text. | | ||
| leftIconName | `IconName` | | Sets the icon to display on the left (See Icon component). | | ||
| onClickButton | `() => void` | | Function to handle onclick. | | ||
| required | `boolean` | `false` | If `true`, sets the html input as `required` and adds the red required text. | | ||
| rightIconName | `IconName` | | Sets the icon to display on the right (See Icon component). | | ||
| unit | `'days'` `'hrs'` `'mins'` | | Sets the unit to display. | | ||
Sorry, the diff of this file is not supported yet
23015
8.49%33
83.33%