Skip to main content

Class: BlazeInput

ui/input.BlazeInput

Hierarchy

Constructors

constructor

โ€ข new BlazeInput(name, placeholder, size)

Create a BlazeInput.

Parameters

NameTypeDescription
namestringThe input's name attribute
placeholderstringThe input's placeholder
sizenumberThe input's font size in rem units

Overrides

BlazeElement.constructor

Defined in

src/ui/input.ts:28

Properties

element

โ€ข Readonly element: HTMLDivElement

Inherited from

BlazeElement.element

Defined in

src/ui/element.ts:9


input

โ€ข Private input: HTMLInputElement

Defined in

src/ui/input.ts:13


keys

โ€ข Readonly keys: KeyboardHandler

Inherited from

BlazeElement.keys

Defined in

src/ui/element.ts:11


label

โ€ข Private label: BlazeText<HTMLParagraphElement>

Defined in

src/ui/input.ts:14


mouse

โ€ข Readonly mouse: MouseHandler

Inherited from

BlazeElement.mouse

Defined in

src/ui/element.ts:10


name

โ€ข Private name: string

Defined in

src/ui/input.ts:7


onInput

โ€ข onInput: (value: string) => void

Type declaration

โ–ธ (value): void

Callback that is fired whenever the input's value changes.

Parameters
NameType
valuestring
Returns

void

Defined in

src/ui/input.ts:19


placeholder

โ€ข Private placeholder: string

Defined in

src/ui/input.ts:8


size

โ€ข Private size: number

Defined in

src/ui/input.ts:9


touch

โ€ข Readonly touch: TouchHandler

Inherited from

BlazeElement.touch

Defined in

src/ui/element.ts:12


value

โ€ข Private value: string

Defined in

src/ui/input.ts:11

Methods

addLabel

โ–ธ addLabel(label, aside?): void

Add a label above or to the side of the input.

Parameters

NameTypeDefault valueDescription
labelstringundefinedThe label's text
asidebooleanfalseWether the label is above or to the side of the input

Returns

void

Defined in

src/ui/input.ts:134


getName

โ–ธ getName(): string

Gets the input's name attribute.

Returns

string

The input's name attribute

Defined in

src/ui/input.ts:86


getPlaceholder

โ–ธ getPlaceholder(): string

Gets the input's placeholder attribute.

Returns

string

The input's placeholder attribute

Defined in

src/ui/input.ts:105


getSize

โ–ธ getSize(): number

Gets the input's font size.

Returns

number

The input's font size in rem units

Defined in

src/ui/input.ts:124


getValue

โ–ธ getValue(): string

Gets the input's current value.

Returns

string

The input's current value

Defined in

src/ui/input.ts:67


removeLabel

โ–ธ removeLabel(): void

Remove the input's label.

Returns

void

Defined in

src/ui/input.ts:153


setName

โ–ธ setName(name): void

Sets the input's name.

Parameters

NameTypeDescription
namestringThe input's new name attribute

Returns

void

Defined in

src/ui/input.ts:76


setPlaceholder

โ–ธ setPlaceholder(placeholder): void

Sets the input's placeholder.

Parameters

NameType
placeholderstring

Returns

void

Defined in

src/ui/input.ts:95


setSize

โ–ธ setSize(size): void

Sets the input's font size.

Parameters

NameTypeDescription
sizenumberThe input's font size in rem units

Returns

void

Defined in

src/ui/input.ts:114


setValue

โ–ธ setValue(value): void

Sets the input's value.

Parameters

NameTypeDescription
valuestringThe input's new value

Returns

void

Defined in

src/ui/input.ts:55