Reference Source
import {CharacterCount} from '@adobe/coral-spectrum'
public class | source

CharacterCount

Expression Extends:

class CharacterCount extends BaseComponent(HTMLElement)

Mixin Extends:

HTMLElement, BaseComponent

A CharacterCount component that indicates the remaining characters in a Textfield or Textarea.

See:

Example:

Markup
<coral-charactercount></coral-charactercount>
JS constructor
new Coral.CharacterCount();

Static Member Summary

Static Public Members
public static

Returns CharacterCount target options.

Member Summary

Public Members
public

Maximum character length for the TextField/TextArea (will be read from target field markup if able).

public

The target Textfield or Textarea for this component.

Static Public Members

public static target: CharacterCountTargetEnum: * source

Returns CharacterCount target options.

Public Members

public maxLength: Number source

Maximum character length for the TextField/TextArea (will be read from target field markup if able).

  • null by default.
  • reflected

public target: HTMLElement | String source

The target Textfield or Textarea for this component. It accepts values from CharacterCountTargetEnum, as well as any DOM element or CSS selector.

  • CharacterCountTargetEnum.PREVIOUS by default.