# IconButton

Icon button component with set of default icons and options to render any icon

## Installation

```tsx
import { IconButton } from 'uxp/components';
```

## Signature

```tsx
const IconButton: React.FunctionComponent<IIconButtonProps>
```

## Examples

```tsx
<IconButton
     type="search"
     onClick={()=> {alert("Clicked")}}
     className="custom-css-class"
 />
```

```tsx
<IconButton
     icon="fas search"
     ...
 />
```

## Properties

| Name       | Type                                                                                | Mandatory | Default Value | Example Value |
| ---------- | ----------------------------------------------------------------------------------- | --------- | ------------- | ------------- |
| icon       | [ButtonIcon](https://help.iviva.com/uxp/v5/additional-resources/types/buttonicon)   | No        | -             | -             |
| type       | [IButtonType](https://help.iviva.com/uxp/v5/additional-resources/types/ibuttontype) | No        | -             | -             |
| active     | boolean                                                                             | No        | -             | -             |
| disabled   | boolean                                                                             | No        | -             | -             |
| onClick    | (e?: React.MouseEvent) => void \| Promise                                           | No        | -             | -             |
| onError    | (e: React.MouseEvent) => void                                                       | No        | -             | -             |
| className  | string                                                                              | No        | -             | -             |
| borderless | boolean                                                                             | No        | -             | -             |
| buttonType | "button" \| "submit" \| "reset"                                                     | No        | -             | -             |
| variant    | 'primary' \| 'secondary' \| 'danger'                                                | No        | -             | -             |
| size       | [IButtonSize](https://help.iviva.com/uxp/v5/additional-resources/types/ibuttonsize) | No        | -             | -             |

## Related Types

* [IIconButtonProps](https://help.iviva.com/uxp/v5/additional-resources/types/iiconbuttonprops)
* [ButtonIcon](https://help.iviva.com/uxp/v5/additional-resources/types/buttonicon)
* [PHIconProp](https://help.iviva.com/uxp/v5/additional-resources/types/phiconprop)
* [PHIconPrefix](https://help.iviva.com/uxp/v5/additional-resources/types/phiconprefix)
* [IButtonType](https://help.iviva.com/uxp/v5/additional-resources/types/ibuttontype)
* [IButtonSize](https://help.iviva.com/uxp/v5/additional-resources/types/ibuttonsize)
