Skip to main content

Input

scoped

Input element extends the capabilities of standard HTML input with advanced features and customization options.

Basic usage​

The sample shows the input in its base state without the extended modes to make the default behavior and markup clear.

Use in the form​

The sample embeds the input into the actual form, so you can see the submit flow and the binding to the normal form behavior.

Variant: standard​

Input also supports the visual of standard HTML input by adding the variant property with the value standard.

Number​

The sample shows type="number" with a decimal step step="0.01" and inputmode="decimal". It compares the clearable variant with the plain one; when clearable is used, the native number controls remain visible and the clear button is placed before them.

Standard in the form​

The sample combines the standard input variant with the form context to show how it behaves in a standard form layout.

In combination with the Button elementorm, it creates a full-featured search box.

Pickers​

The sample interfaces wje-input with the wje-icon-picker and wje-color-picker components via wje-dropdown in the start slot. The trigger remains part of the input, the picker opens as an overlay and after the picker dispatches a select event that immediately updates the value of the parent input.

Clearable​

In combination with the Button elementorm, it creates a full-featured search box.

Clearable input reserves room for the clear button even with long values. With type="number" it also accounts for native number controls, so the clear button does not overlap the value steppers.

When to use​

Use wje-input when the user enters a value, selects options, or performs an action on a form.

When not to use​

Don't just use it as a visual decorative element without interaction. In this case, give priority to the presentation components.

Accessibility​

Always link the component to the description (label/aria-label), keep keyboard control, and display a clear message on validation errors.

  • Keep validation rules and error states consistent across the entire form.
  • For asynchronous operations, display the load status or disabled status.
  • For complex forms, prefer smaller sections and immediate feedback.

Attributes and properties​

clearable​

PopisUrčuje, či je voľba clearable zapnutá a ovplyvňuje správanie komponentu.
Atribútclearable
Typboolean
Predvolenéfalse

customErrorDisplay​

PopisRiadi validáciu alebo stavové hlášky pre voľbu custom-error-display.
Atribútcustom-error-display
Typboolean
Predvolenéfalse

disabled​

PopisVypína používateľskú interakciu s komponentom.
Atribútdisabled
Typboolean
Predvolené-

errorInline​

PopisUrčuje, či sa validačná chyba zobrazí priamo pri vstupe.
Atribúterror-inline
Typany
Predvolené-

inputmode​

PopisRiadi správanie voľby inputmode v komponente.
Atribútinputmode
Typany
Predvolené-

invalid​

PopisRiadi validáciu alebo stavové hlášky pre voľbu invalid.
Atribútinvalid
Typboolean
Predvolenéfalse

label​

PopisNastavuje zobrazený alebo prístupný textový štítok.
Atribútlabel
Typstring
Predvolenéfalse

max​

PopisNastavuje maximálnu povolenú hodnotu.
Atribútmax
Typany
Predvolené-

message​

PopisNastavuje pomocný alebo validačný text pod vstupom.
Atribútmessage
Typany
Predvolené-

min​

PopisNastavuje minimálnu povolenú hodnotu.
Atribútmin
Typany
Predvolené-

name​

PopisNastavuje názov poľa pri odoslaní formulára.
Atribútname
Typany
Predvolené-

placeholder​

PopisNastavuje zástupný text pri prázdnej hodnote.
Atribútplaceholder
Typstring
Predvolené-

readonly​

PopisZabráni používateľovi upravovať hodnotu.
Atribútreadonly
Typboolean
Predvolené-

required​

PopisOznačí komponent ako povinný pre validáciu formulára.
Atribútrequired
Typboolean
Predvolené-

step​

PopisRiadi správanie voľby step v komponente.
Atribútstep
Typany
Predvolené-

type​

PopisNastavuje typ vstupu, ktorý riadi spracovanie a validáciu hodnoty.
Atribúttype
Typany
Predvolené-

validateOnChange​

PopisUrčuje, či je voľba validate-on-change zapnutá a ovplyvňuje správanie komponentu.
Atribútvalidate-on-change
Typboolean
Predvolenéfalse

value​

PopisNastavuje aktuálnu hodnotu komponentu.
Atribútvalue
Typstring
Predvolené-

variant​

PopisNastavuje ARIA metadáta, ktoré zlepšujú prístupnosť pre asistenčné technológie.
Atribútvariant
Typstring
Predvolenédefault

Events​

NázovPopis
wje-input:inputVyvolá sa pri zmene vstupnej hodnoty.
wje-input:clearVyvolá sa pri vyčistení vstupu alebo výberu.

Methods​

hasSlot​

PopisOverí, či komponent obsahuje slot.
Signatúra(el: HTMLElement, slotName: string) => boolean

CSS shadow parts​

NázovPopis
nativeŠtýluje koreňovú shadow časť komponentu.
wrapperŠtýluje obalovú shadow časť.
inputŠtýluje shadow časť input.
clearŠtýluje shadow časť clear.

CSS custom variables​

NázovPopis
--wje-input-font-familyVlastná CSS premenná, ktorá riadi typografiu.
--wje-input-background-colorVlastná CSS premenná, ktorá riadi background color.
--wje-input-colorVlastná CSS premenná, ktorá riadi color.
--wje-input-color-invalidVlastná CSS premenná, ktorá riadi color invalid.
--wje-input-error-background-colorVlastná CSS premenná, ktorá riadi error background color.
--wje-input-error-colorVlastná CSS premenná, ktorá riadi error color.
--wje-input-border-colorVlastná CSS premenná, ktorá riadi border color.
--wje-input-border-color-focusVlastná CSS premenná, ktorá riadi border color focus.
--wje-input-border-widthVlastná CSS premenná, ktorá riadi border width.
--wje-input-border-styleVlastná CSS premenná na štýlovanie komponentu (border style).
--wje-input-border-radiusVlastná CSS premenná, ktorá riadi zaoblenie rohov.
--wje-input-margin-bottomVlastná CSS premenná, ktorá riadi margin bottom.
--wje-input-line-heightVlastná CSS premenná, ktorá riadi výšku riadku.
--wje-input-slot-padding-inlineVlastná CSS premenná, ktorá riadi slot padding inline.

Slots​

NázovPopis
startSlot pre obsah zobrazený pred hlavným obsahom.
endSlot pre obsah zobrazený za hlavným obsahom.