PasswordComponent
A component that allows the user to enter a password.
You can add this component using SettingEx.addPassword.
In order to add the styles for the component, use initPluginContext in your plugin’s onload() function.
Alternatively, you can copy styles from https://github.com/mnaoumov/obsidian-dev-utils/releases/latest/download/styles.css.
Import:
import { PasswordComponent } from 'obsidian-dev-utils/obsidian/setting-components/password-component';Signature:
export class PasswordComponent extends TypedTextComponent<string>Extends: TypedTextComponent<string>
Constructor
new PasswordComponent(containerEl: HTMLElement)Creates a new password component.
Properties
| Property | Type | Description |
|---|---|---|
| inputEl | HTMLInputElement | An input element of the component. (Inherited from TypedTextComponent) |
| textComponent | TextComponent | The inner text component. (Inherited from TypedTextComponent) |
Methods
| Method | Returns | Description |
|---|---|---|
| getValue() | string | Gets the value of the component. (Inherited from TypedTextComponent) |
| onChange(callback) | this | Sets the callback function to be called when the component is changed. (Inherited from TypedTextComponent) |
| onChanged() | void | Called when the component is changed. (Inherited from TypedTextComponent) |
| setDisabled(disabled) | this | Sets the disabled state of the component. (Inherited from TypedTextComponent) |
| setPlaceholder(placeholder) | this | Sets the placeholder value of the component. |
| setValue(value) | this | Sets the value of the component. (Inherited from TypedTextComponent) |
| valueFromString(str) | string | Gets the value from a string. |
| valueToString(value) | string | Converts a value to a string. (Inherited from TypedTextComponent) |
Links to this page: