Avenra
Liquid GlassAPI Reference
Liquid GlassAPI Reference

createLiquidInput

Glass-wrapped text input component.

createLiquidInput

Creates a text input field wrapped in a glass effect.

Basic Usage

import { createLiquidInput } from '@avenra/liquid-glass';

const input = createLiquidInput('#input-container', {
  placeholder: 'Enter your name...',
  value: ''
});

input.on('input', (e) => console.log('Current text:', input.value));

Props / Options

Extends LiquidGlassOptions plus:

PropTypeDefaultDescription
placeholderstring''Input placeholder text
valuestring''Initial value
typestring'text'HTML input type (text, password, email, etc.)

Return Value — LiquidInputHandle

MemberTypeDescription
elementElementThe wrapper container element
valuestring (get/set)Current input value
focus()() => thisFocus the inner input element
blur()() => thisBlur the inner input element
destroy()() => voidClean up the component
on('input', cb)EventFired on any input change
on('change', cb)EventFired when input loses focus after change
on('focus', cb)FocusEventFired on focus
on('blur', cb)FocusEventFired on blur
on('destroy', cb)undefinedFired on destruction

On this page