CSC Design System next
VueFlavour Vue React Angular TypeScript PrimaryCSC UI ColorsPrimarySecondaryAccentCustom ColorsRedOrangeGreenBluePurplePink
Guides Getting started Customization Data visualization Migration guide Componentsc-accordionc-alertc-autocompletec-badgec-buttonc-button-groupc-cardc-checkboxc-csc-logoc-data-tablec-dividerc-iconc-icon-buttonc-inputc-linkc-listc-loaderc-login-buttonsc-login-cardc-mainc-menuc-messagec-modalc-navigation-buttonc-otp-inputc-pagec-paginationc-popoverc-progress-barc-progress-circlec-radio-groupc-selectc-side-navigationc-sliderc-spinnerc-statusc-stepsc-switchc-tablec-tabsc-tagsc-text-fieldc-toastsc-toolbarc-tooltip

<c-icon-button>

Examples

Basic
Vue React Angular TypeScript
<template>
  <div class="example-row">
    <c-icon-button>
      <c-icon :path="mdiPlus" />
    </c-icon-button>

    <c-icon-button outlined>
      <c-icon :path="mdiPencil" />
    </c-icon-button>

    <c-icon-button ghost>
      <c-icon :path="mdiHeart" />
    </c-icon-button>

    <c-icon-button text>
      <c-icon :path="mdiDotsVertical" />
    </c-icon-button>

    <c-icon-button danger>
      <c-icon :path="mdiDelete" />
    </c-icon-button>

    <c-icon-button badge="3">
      <c-icon :path="mdiBellOutline" />
    </c-icon-button>

    <c-icon-button disabled>
      <c-icon :path="mdiPlus" />
    </c-icon-button>
  </div>
</template>

<script setup lang="ts">
import {
  mdiBellOutline,
  mdiDelete,
  mdiDotsVertical,
  mdiHeart,
  mdiPencil,
  mdiPlus,
} from '@mdi/js';
</script>
Sizes
Vue React Angular TypeScript
<template>
  <div class="example-row">
    <c-icon-button size="x-small">
      <c-icon :path="mdiMagnify" />
    </c-icon-button>

    <c-icon-button size="small">
      <c-icon :path="mdiMagnify" />
    </c-icon-button>

    <c-icon-button>
      <c-icon :path="mdiMagnify" />
    </c-icon-button>
  </div>
</template>

<script setup lang="ts">
import { mdiMagnify } from '@mdi/js';
</script>

API reference

<c-icon-button>

Properties

PropertyAttributeTypeDefaultDescription
badgebadgenull | number | stringnullShow a badge on top of the icon
dangerdangerbooleanfalseDanger variant of the button
disableddisabledbooleanfalseDisable the button
ghostghostbooleanfalseGhost variant of the button
invertedinvertedbooleanfalseInverted color for dark backgrounds
loadingloadingbooleanfalseLoading variant of the button
outlinedoutlinedbooleanfalseOutlined variant of the button
pathpathstring''Path for the svg icon
sizesizeCIconButtonSize'default'Size of the button
texttextbooleanfalseText variant of the button

Slots

SlotDescription
defaultDefault slot for the icon

CSS parts

Style from outside with c-icon-button::part(name) — parts are the library's only styling customization API.

PartDescription
rootThe native `<button>` element carrying the visual styling
contentInner wrapper around the slotted icon or loading spinner
badgeThe badge bubble shown in the button's corner

Types

Importable from the package root: import type { … } from '@cscfi/csc-ui'

CIconButtonProps
export interface CIconButtonProps {
  /**
   * Show a badge on top of the icon
   *
   * @seeded from csc-ui — verify
   */
  badge?: null | number | string;
  /**
   * Danger variant of the button
   *
   * @seeded from csc-ui — verify
   */
  danger?: boolean;
  /**
   * Disable the button
   *
   * @seeded from csc-ui — verify
   */
  disabled?: boolean;
  /**
   * Ghost variant of the button
   *
   * @seeded from csc-ui — verify
   */
  ghost?: boolean;
  /**
   * Inverted color for dark backgrounds
   *
   * @seeded from csc-ui — verify
   */
  inverted?: boolean;
  /**
   * Loading variant of the button
   *
   * @seeded from csc-ui — verify
   */
  loading?: boolean;
  /**
   * Outlined variant of the button
   *
   * @seeded from csc-ui — verify
   */
  outlined?: boolean;
  /**
   * Path for the svg icon
   *
   * @seeded from csc-ui — verify
   * @freeform SVG path data
   */
  path?: string;
  /**
   * Size of the button
   *
   * @seeded from csc-ui — verify
   */
  size?: CIconButtonSize;
  /**
   * Text variant of the button
   *
   * @seeded from csc-ui — verify
   */
  text?: boolean;
}
CIconButtonSize

Size of the icon button. `small` and `x-small` render progressively more compact buttons; omitting the attribute renders the default size.

export type CIconButtonSize = 'default' | 'small' | 'x-small';