Skip to main content
BEEQ Input component overview
Inputs let users enter a short value in a familiar, single-line control. Use them when people need to type information directly and you want the field to support labels, helper text, inline validation, and optional prefix or suffix content.
Use bq-input for single-line entry. If the answer may span multiple lines, use a textarea. If the user must pick from known options, use a select or dropdown. If the value is a date, use a date picker.

When to use

Use inputs when
  • You need a single-line field for names, email addresses, passwords, codes, URLs, or similar short values
  • Typing is faster than choosing from a list
  • Users benefit from inline helper text, validation, or browser autofill
  • The field should accept semantic input types such as email, password, search, or tel

Do not use inputs when
  • The user must choose from a fixed set of options
  • The answer is likely to be long or multi-line
  • A specialized control would reduce errors, such as a date picker or autocomplete pattern
  • The field purpose would only be understandable through placeholder text

Patterns

Single-line form field

The default pattern for account details, profile data, contact information, and short reference values.

Credential field

Works well for passwords, one-time codes, and other controlled text values where labels and validation matter.

Search or filter entry

Use an input when users refine content by typing a term, especially when the field benefits from a search-specific type or icon.

Structured browser-assisted input

Inputs support browser features such as autofill, autocomplete, and keyboard hints, which help users finish forms faster and with fewer mistakes.

Anatomy

BEEQ Input component anatomy
An input combines a persistent label with a single-line text field and optional supporting content. Keep the label visible, use helper text for guidance or feedback, and treat placeholder text as an example rather than an instruction.
PartElementDescription
1LabelPersistent field name shown through the label slot
2ControlThe bordered container that groups the editable field and optional affordances
3Native inputThe actual text input used for typing, autofill, and form submission
4PrefixOptional leading content inside the control, usually an icon
5SuffixOptional trailing content inside the control, often a status or supporting icon
6Helper textSupporting guidance or validation feedback shown below the field
7Clear buttonOptional action that appears when the field has a value and clearing is enabled

Design guidelines

Use this sequence when you define an input:
1

Choose the right type

Start with the most specific native type that matches the data, such as email, password, search, tel, or number.
2

Write the label first

Make the field purpose clear with a persistent label. Use helper text for extra context and keep placeholder text for examples only.
3

Support fast completion

Add semantic attributes such as autocomplete, required, and pattern only when they meaningfully improve completion or validation.
When the field has a value and disable-clear is not set, the component can surface a built-in clear action. You do not need to build a separate clear button for common text-entry cases.

Usage

Default

Use the default type of input when you want to provide a simple, versatile field for gathering user input. You do not need to specify any additional property that already uses its default value.

Value

Use the value attribute to provide a convenient solution for scenarios where the initial input is predefined.

Prefix

Use the prefix slot when you want to place an icon before the input value to provide extra context.

Suffix

Use the suffix slot when you want to add an icon after the input field for extra context or feedback.

Prefix and Suffix

This variant combines both prefix and suffix features within the same input.

Disabled

Use the disabled attribute when the input field should be visible but non-editable.

Options

Validation

Use this variant for validation feedback by setting validation-status to error, success, warning, or none.

Label with “Optional”

Use this style when you want to include an optional marker to provide additional context.

Label with “Info Tooltip”

Use this style when you want to include an informational tooltip alongside the input label.

With no label

Use this variant when the surrounding context already makes the field purpose clear and a visible label would be redundant.

With no Helper Text

Use this variant when the field does not require supplementary guidance.

Best practices

DoKeep labels short, specific, and visible after users start typing.

Don’tRely on placeholder text as the only explanation of what the field is for.

DoWrite helper text that explains format, constraints, or what happens next in plain language.

Don’tFill the space under the field with long, repetitive instructions users will skip.

DoMatch field type, width, and ordering to the data people are expected to enter.

Don’tMake users jump across multiple columns or guess which fields belong together.

DoExplain validation close to the field and tell users how to recover from an error.

Don’tUse color alone to communicate validity or leave users guessing which format is required.

Accessibility

  • Built in: the component forwards semantic input attributes such as type, autocomplete, required, readonly, min, max, maxlength, minlength, pattern, and step to the native input element.
  • Built in: when disabled is set, the native input receives aria-disabled="true" so assistive technologies can detect the unavailable state.
  • Built in: the clear button uses clearButtonLabel as its accessible name, and the default clear icon is marked aria-hidden="true".
  • Built in: the component participates in forms and can surface native required-state validity when you combine required with formValidationMessage.
  • You must: provide meaningful content in the label slot for most cases, even when the surrounding layout makes the field purpose look obvious visually.
  • You must: treat helper and validation text as instructions, not decoration. Keep it concise and make recovery steps explicit.
  • You must: avoid placeholder-only labeling because placeholder text disappears as soon as the user types.
  • You must: add alternate context when you intentionally omit the visible label, so screen reader and keyboard users still understand the field purpose.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
autocapitalizeautocapitalizeControls capitalization behavior for typed textstring"off"
autocompleteautocompleteHints whether and how the browser should autocomplete the fieldstring"off"
autofocusautofocusIf true, the input is focused on component renderbooleanfalse
clearButtonLabelclear-button-labelAccessible label for the clear buttonstring"Clear value"
debounceTimedebounce-timeDelay before the bqInput event is emitted after the value changesnumber0
disableCleardisable-clearIf true, the clear button is hiddenbooleanfalse
disableddisabledDisables the inputbooleanfalse
formformID of the form the input belongs tostringundefined
formValidationMessageform-validation-messageNative validation message used when required is setstringundefined
inputmodeinputmodeHints the most helpful virtual keyboard for the expected valuestringundefined
maxmaxMaximum accepted value for date and number typesnumber | stringundefined
maxlengthmaxlengthMaximum accepted number of charactersnumberundefined
minminMinimum accepted value for date and number typesnumber | stringundefined
minlengthminlengthMinimum accepted number of charactersnumberundefined
namenameName of the underlying inputstringundefined
patternpatternRegular expression the value should matchstringundefined
placeholderplaceholderPlaceholder text shown when the field is emptystringundefined
readonlyreadonlyIf true, the value can be focused and copied but not editedbooleanundefined
requiredrequiredMarks the field as requiredbooleanundefined
stepstepGranularity constraint for compatible input types"any" | numberundefined
typetypeNative input type to render"date" | "datetime-local" | "email" | "number" | "password" | "search" | "tel" | "text" | "time" | "url""text"
validationStatusvalidation-statusValidation state of the control"error" | "none" | "success" | "warning""none"
valuevalueCurrent input valuenumber | string | string[]undefined

Events

EventDescriptionType
bqBlurFired when the input loses focusCustomEvent<HTMLBqInputElement>
bqChangeFired when the value changes and the input loses focusCustomEvent<{ value: string | number | string[]; el: HTMLBqInputElement }>
bqClearFired when the value is clearedCustomEvent<HTMLBqInputElement>
bqFocusFired when the input receives focusCustomEvent<HTMLBqInputElement>
bqInputFired on every keystroke as the value changesCustomEvent<{ value: string | number | string[]; el: HTMLBqInputElement }>

Slots

SlotDescription
labelLabel content for the field
prefixOptional leading content inside the control
suffixOptional trailing content inside the control
helper-textSupporting text displayed below the field
clear-iconReplaces the default clear icon

Shadow parts

PartDescription
baseBase wrapper for the component
buttonNative button used for the clear action
clear-btnClear button container
controlInput control wrapper
helper-textHelper text container
inputNative HTML input element
labelLabel slot container
prefixPrefix slot container
suffixSuffix slot container

CSS custom properties

Resources

Interactive playground

Explore input variants and states in Storybook.

Source code

View the component source on GitHub.