Skip to content

TypedTextComponent<T>

A component that displays and edits a text-based value.

Import:

import { TypedTextComponent } from 'obsidian-dev-utils/obsidian/setting-components/typed-text-component';

Signature:

export class TypedTextComponent<T> extends ValueComponent<T> implements ValidatorComponent, ValueComponentWithChangeTracking<T>

Extends: ValueComponent<T>

Implements: ValidatorComponent, ValueComponentWithChangeTracking<T>

Constructor

new TypedTextComponent(params: TypedTextComponentConstructorParams)

Creates a new typed text component.

Properties

PropertyTypeDescription
inputElHTMLInputElementAn input element of the component.
textComponentTextComponentThe inner text component.
validatorElValidatorElementA validator element of the component.
(Inherited from ValidatorComponent)

Methods

MethodReturnsDescription
getValue()TGets the value of the component.
onChange(callback)thisSets the callback function to be called when the component is changed.
onChange(callback)thisSets a callback function to be called when the value of the component changes.
(Inherited from ValueComponentWithChangeTracking)
onChanged()voidCalled when the component is changed.
setDisabled(disabled)thisSets the disabled state of the component.
setValue(value)thisSets the value of the component.
valueFromString(str)TConverts a string to a value.
valueToString(value)stringConverts a value to a string.

Links to this page: