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

Examples

Basic
Vue React Angular TypeScript
<template>
  <div>
    <c-input
      :filled.prop="query.length > 0"
      hint="c-input is the field shell — you provide the native input"
      input-id="example-search"
      label="Search"
    >
      <input id="example-search" v-model="query" type="text" />
    </c-input>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const query = ref('');
</script>

API reference

<c-input>

Properties

PropertyAttributeTypeDefaultDescription
activeactivebooleanfalseSet by the wrapping form component when its input has focus or holds a value.
disableddisabledbooleanfalseDisable the input
errorMessageerror-messagestring''Error message shown in place of the hint while the input is invalid
filledfilledbooleanfalseSet by the wrapping form component when its input holds a value.
hideDetailshide-detailsbooleanfalseHide the hint and error messages
hinthintstring''Hint text for the input
inputIdinput-idstring''id of the inner input element (for the label's htmlFor).
isTextareais-textareabooleanfalseRenders textarea-specific spacing tweaks.
labellabelstring''Label of the input
labelOnToplabel-on-topbooleanfalseLabel on top of the input
requiredrequiredbooleanfalseSet the input as required
shadowshadowbooleanfalseShadow variant of the input
sizesizeCFieldSize'default'Field height: the 44px default or the 36px `small` box
validvalidbooleantrueSet the validíty of the input

Slots

SlotDescription
preLeading content (e.g. an icon) inside the field, before the input
defaultThe native `<input>` / `<textarea>` element the field wraps
postTrailing content (e.g. an icon or button) inside the field, after the input

CSS parts

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

PartDescription
rootThe outer wrapper of the whole input control
labelThe label element — the on-top label or the floating in-field label, depending on `labelOnTop`
preWrapper around the `pre` slot content
postWrapper around the `post` slot content
messageThe hint / error message area below the field

Types

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

CFieldSize shared

Field height of the form controls built on `c-input`. `default` is the 44px field; `small` is the 36px field. Owned here because the value passes from the wrapping control (`c-select`) into `c-input`.

export type CFieldSize = 'default' | 'small';