File

src/input/input.directive.ts

Description

A directive for applying styling to an input element.

Example:

<input ibmText/>

See the vanilla carbon docs for more detail.

Metadata

selector [ibmText]

Index

Inputs
HostBindings

Inputs

theme

light or dark input theme

Type: "light" | "dark"

Default value: dark

HostBindings

class.bx--text-input
class.bx--text-input:
Default value : true
class.bx--text-input--light
class.bx--text-input--light:
import { Directive, HostBinding, Input } from "@angular/core";

/**
 * A directive for applying styling to an input element.
 *
 * Example:
 *
 * ```html
 * <input ibmText/>
 * ```
 *
 * See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/text-input/code) for more detail.
 */
@Directive({
	selector: "[ibmText]"
})
export class TextInput {
	/**
	 * `light` or `dark` input theme
	 */
	@Input() theme: "light" | "dark" = "dark";

	@HostBinding("class.bx--text-input") inputClass = true;
	@HostBinding("class.bx--text-input--light") get isLightTheme() {
		return this.theme === "light";
	}
}

results matching ""

    No results matching ""