Skip to main content

Input

scoped

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

Basic usage

Use in the form

Variant: standard

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

Standard in the form

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

Pickers

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

Clearable

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

When to use

Use wje-input when users need to enter values, choose options, or trigger form-related actions.

When not to use

Do not use it as a decorative element without interaction. Prefer presentational components in that case.

Accessibility

Always provide a label (label/aria-label), keep keyboard support, and surface clear validation feedback.

Best Practices

  • Keep validation rules and error behavior consistent across the entire form.
  • Show loading or disabled states during async operations.
  • Split complex forms into smaller sections with immediate feedback.

Attributes and Properties

type

DescriptionSets the input type that controls value parsing and validation.
Attributetype
Typeany
Default-

value

DescriptionRetrieves the value from the input element if available; otherwise, returns the internal _value property or an empty string as the default.
Attributevalue
Typestring
Default-

name

DescriptionSets the field name used when submitting form data.
Attributename
Typeany
Default-

disabled

DescriptionDisables user interaction with the component.
Attributedisabled
Typeany
Default-

placeholder

DescriptionRetrieves the value of the 'placeholder' attribute from the element. If the attribute is not set, it returns an empty string.
Attributeplaceholder
Typestring
Default-

label

DescriptionRetrieves the value of the 'label' attribute if it exists. If the 'label' attribute is not set, it returns false.
Attributelabel
Typestring|boolean
Default-

message

DescriptionSets helper or validation text shown below the input.
Attributemessage
Typeany
Default-

errorInline

DescriptionControls whether validation errors are rendered inline.
Attributeerror-inline
Typeany
Default-

required

DescriptionMarks the component as required for form validation.
Attributerequired
Typeany
Default-

readonly

DescriptionPrevents the value from being edited by the user.
Attributereadonly
Typeany
Default-

invalid

DescriptionControls validation or status messaging for invalid.
Attributeinvalid
Typeboolean
Defaultfalse

Events

NameDescription
wje-input:inputDispatched when the input value changes.
wje-input:clearDispatched when the input is cleared.

Methods

hasSlot

DescriptionChecks whether the input has a slot.
Signature(el: HTMLElement, slotName: string) => boolean

CSS Shadow Parts

NameDescription
nativeThe native part.
wrapperThe wrapper part.
inputThe input part.
clearThe clear part.

CSS Custom Properties

NameDescription
--wje-input-font-familyDefines the font family for the input text.
--wje-input-background-colorSpecifies the background color of the input field.
--wje-input-colorSets the text color within the input field.
--wje-input-color-invalidChanges the text color when the input value is invalid.
--wje-input-border-colorDefines the border color of the input field.
--wje-input-border-color-focusSpecifies the border color when the input is focused.
--wje-input-border-widthSets the width of the input border.
--wje-input-border-styleDefines the border style of the input (e.g., solid, dashed).
--wje-input-border-radiusSpecifies the border radius, creating rounded corners.
--wje-input-margin-bottomAdds spacing below the input field.
--wje-input-line-heightSets the line height of the text within the input field.
--wje-input-slot-padding-inlineControls the padding on the left and right of the input slot content.

Slots

NameDescription
startSlot for content at the start of the input.
endSlot for content at the end of the input.