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-button>

Buttons trigger actions — submitting a form, opening a modal, confirming a choice. Use one primary (default appearance) button per view; secondary actions use the `outlined`, `ghost` or `text` appearances.

Usage

When to use

  • Performing an action on the current page (save, send, confirm).
  • Navigating with button semantics: set href to render a real link styled as a button.

When not to use

  • Inline navigation within text — use c-link.
  • Toggling a persistent on/off state — use c-switch.

Accessibility

The root part is a native <button> (or <a> when href is set), so focus, keyboard activation and screen-reader semantics come from the platform. When only an icon is slotted, provide an accessible name on the host, e.g. aria-label="Close".

Customization

Restyle via CSS parts from your own stylesheet:

c-button::part(root) {
  border-radius: 9999px;
}

Examples

Sizes
Vue React Angular TypeScript
<template>
  <div class="example-row">
    <c-button size="small">Small</c-button>

    <c-button>Default</c-button>

    <c-button size="large">Large</c-button>
  </div>
</template>
Variants
Vue React Angular TypeScript
<template>
  <div class="example-row">
    <c-button>Default</c-button>

    <c-button outlined>Outlined</c-button>

    <c-button ghost>Ghost</c-button>

    <c-button text>Text</c-button>

    <c-button danger>Danger</c-button>

    <c-button disabled>Disabled</c-button>
  </div>
</template>

API reference

<c-button>

Buttons trigger actions — submitting a form, opening a modal, confirming a choice. Use one primary (default appearance) button per view; secondary actions use the `outlined`, `ghost` or `text` appearances.

Properties

PropertyAttributeTypeDefaultDescription
activeactivebooleanPressed (toggle) state — renders the selected look and sets `aria-pressed`. Leave unset for regular action buttons: only a true/false value marks the button as a toggle. Driven by `c-button-group` on its slotted buttons.
dangerdangerbooleanfalseDanger variant style
disableddisabledbooleanfalseDisable the button
fitfitbooleanfalseFit width to containing element
ghostghostbooleanfalseLight button background
hostIdhost-idstring''Id of the button
hrefhrefstring''Hyperlink url
invertedinvertedbooleanfalseInverted button style for dark backgrounds
loadingloadingbooleanfalseDisplay loader on the button
noRadiusno-radiusbooleanfalseRemove the default border radius
noRippleno-ripplebooleanfalseSuppress the click ripple (e.g. when a wrapper owns the press feedback).
outlinedoutlinedbooleanfalseOutlined button style
sizesizeCButtonSize'default'Size of the button
targettargetstring'_blank'Hyperlink target
texttextbooleanfalseTransparent button background
typetypeCButtonType'button'Button type
valuevaluenumber | stringValue for the button - for use in the c-button-group

Slots

SlotDescription
defaultButton label content.
iconLeading icon, vertically centered before the label.
descriptionSecondary text rendered below the label.

CSS parts

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

PartDescription
rootThe native `<button>` / `<a>` element carrying the visual styling.
contentLayout wrapper for the label, icon and description.
descriptionWrapper of the `description` slot.

CSS custom properties

PropertyDescription
--c-font-familyFont stack applied to the label (native buttons do not inherit it).

Types

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

CButtonProps
export interface CButtonProps {
  /**
   * Pressed (toggle) state — renders the selected look and sets
   * `aria-pressed`. Leave unset for regular action buttons: only a
   * true/false value marks the button as a toggle. Driven by
   * `c-button-group` on its slotted buttons.
   */
  active?: boolean;
  /**
   * Danger variant style
   *
   * @seeded from csc-ui — verify
   */
  danger?: boolean;
  /**
   * Disable the button
   *
   * @seeded from csc-ui — verify
   */
  disabled?: boolean;
  /**
   * Fit width to containing element
   *
   * @seeded from csc-ui — verify
   */
  fit?: boolean;
  /**
   * Light button background
   *
   * @seeded from csc-ui — verify
   */
  ghost?: boolean;
  /**
   * Id of the button
   *
   * @seeded from csc-ui — verify
   * @freeform
   */
  hostId?: string;
  /**
   * Hyperlink url
   *
   * @seeded from csc-ui — verify
   * @freeform any URL
   */
  href?: string;
  /**
   * Inverted button style for dark backgrounds
   *
   * @seeded from csc-ui — verify
   */
  inverted?: boolean;
  /**
   * Display loader on the button
   *
   * @seeded from csc-ui — verify
   */
  loading?: boolean;
  /**
   * Remove the default border radius
   *
   * @seeded from csc-ui — verify
   */
  noRadius?: boolean;
  /** Suppress the click ripple (e.g. when a wrapper owns the press feedback). */
  noRipple?: boolean;
  /**
   * Outlined button style
   *
   * @seeded from csc-ui — verify
   */
  outlined?: boolean;
  /**
   * Size of the button
   *
   * @seeded from csc-ui — verify
   */
  size?: CButtonSize;
  /**
   * Hyperlink target
   *
   * @seeded from csc-ui — verify
   * @freeform any browsing-context name (e.g. _blank, _self)
   */
  target?: string;
  /**
   * Transparent button background
   *
   * @seeded from csc-ui — verify
   */
  text?: boolean;
  /**
   * Button type
   *
   * @seeded from csc-ui — verify
   */
  type?: CButtonType;
  /**
   * Value for the button
   * - for use in the c-button-group
   *
   * @seeded from csc-ui — verify
   */
  value?: number | string;
}
CButtonSize

Size of the button.

export type CButtonSize = 'default' | 'large' | 'small';
CButtonType

Native `type` of the underlying `<button>` element. Ignored when `href` turns the component into a link.

export type CButtonType = 'button' | 'reset' | 'submit';