File

src/input/text-area.directive.ts

Description

A directive for applying styling to a textarea element.

Example:

Example :
<textarea cdsTextArea></textarea>

See the vanilla carbon docs for more detail.

Metadata

Index

Properties
Inputs
HostBindings
Accessors

Inputs

invalid
Type : boolean
Default value : false
skeleton
Type : boolean
Default value : false
theme
Type : "light" | "dark"
Default value : "dark"

HostBindings

attr.data-invalid
Type : boolean
class.cds--text-area
Type : boolean
Default value : true
class.cds--text-area--light
Type : boolean

Properties

baseClass
Default value : true
Decorators :
@HostBinding('class.cds--text-area')

Accessors

isLightTheme
getisLightTheme()
getInvalidAttr
getgetInvalidAttr()
import { Directive, HostBinding, Input } from "@angular/core";

/**
 * A directive for applying styling to a textarea element.
 *
 * Example:
 *
 * ```html
 * <textarea cdsTextArea></textarea>
 * ```
 *
 * See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/text-input/code) for more detail.
 */
@Directive({
	selector: "[cdsTextArea], [ibmTextArea]"
})
export class TextArea {
	/**
	 * @deprecated since v5 - Use `cdsLayer` directive instead
	 * `light` or `dark` input theme
	 */
	@Input() theme: "light" | "dark" = "dark";

	@HostBinding("class.cds--text-area") baseClass = true;
	@HostBinding("class.cds--text-area--invalid") @Input() invalid = false;
	@HostBinding("class.cds--skeleton") @Input() skeleton = false;
	@HostBinding("class.cds--text-area--light") get isLightTheme() {
		return this.theme === "light";
	}

	@HostBinding("attr.data-invalid") get getInvalidAttr() {
		return this.invalid ? true : undefined;
	}
}

results matching ""

    No results matching ""