Skip to content
On this page

IconButton

Use icons to add more meaning to Button. You can use icon alone to save some space, or use it with text.

Button with icon and text

Add text to default <HcIconButton /> slot if you need a button with text and icon. Use iconName prop or prefix-icon slot to customize the icon

<template>
  <div class="flex justify-between">
    <HcIconButton type="primary">
      Primary
    </HcIconButton>

    <HcIconButton
      type="accent"
      icon-name="download"
    >
      Accent
    </HcIconButton>

    <HcIconButton
      type="default"
      icon-name="filter"
    >
      Default
    </HcIconButton>

    <HcIconButton
      type="delete"
      icon-name="bucket"
    >
      Delete
    </HcIconButton>

    <HcIconButton
      type="success"
      icon-name="download"
    >
      success
    </HcIconButton>
  </div>
</template>

<script lang="ts" setup>
import { HcIconButton } from '@deeepvision/hope-component-kit';
</script>

Button with icon only

If you need a button with icon only you can use <HcIconButton /> component

<template>
  <div class="flex justify-between">
    <HcIconButton
      type="default"
      icon-name="settings"
    />
    <HcIconButton
      type="default"
      icon-name="download"
    />
    <HcIconButton
      type="default"
      icon-name="refresh"
    />
    <HcIconButton
      type="default"
      icon-name="plus"
    />
    <HcIconButton
      type="default"
      icon-name="filter"
    />
    <HcIconButton
      type="default"
      icon-name="edit"
    />
    <HcIconButton
      type="delete"
      icon-name="bucket"
    />
  </div>
</template>

<script lang="ts" setup>
import { HcIconButton } from '@deeepvision/hope-component-kit';
</script>

Props

PropertyType Values Description Default
typeStringprimaryaccentdefaultdelete;change the type of the component and change its styleprimary
nativeType Stringsubmitresetbuttonset native html type for button tagbutton
disabledbooleantruefalsewhether component is disabledfalse
loadingbooleantruefalseadd a loading animation to the input.false
iconClassStringStringset extra class to icon component
iconNameStringStringset custom iconplus

Slots

PropertyType Values Description Default
default-customize default content
prefix-icon-customize prefix icon content

Events

PropertyType Values Description Default
clickFunctionevent - MouseEventtriggers when click on button

Created by DeepVision Software.