Icon Button
A icon button renders an icon within a button.
Usage
- Import the
IconButton
and your preferred icons from “figBlocks”. - The
iconSvg
&iconText
props can be used to specify the icons. - Refer Icon component for further details.
<script> import { IconButton } from 'figblocks'; import { IconStyles } from 'figblocks/icons'; </script> <IconButton iconSvg={IconStyles} /> <IconButton iconSvg={IconStyles} active />
Active state
Pass the active
prop to set the button state to active.
<IconButton iconSvg={IconStyles} active />
Disabled state
Pass the disabled
prop to disable the button.
<IconButton disabled iconSvg={IconStyles} />
Props
active | boolean | false | If true, sets the button state to active. |
disabled | boolean | false | If true, the button will be disabled. |
iconSvg | string | undefined | Refer Icon component. |
iconText | string | undefined | Refer Icon component. |
class | string | undefined | Custom CSS classname for styling |
Events
on:click
on:focus
on:blur
on:mouseover
on:mouseenter
on:mouseleave