Skip to content

Text

Edit Unicode text while preserving selection and IME composition.

Usage

Unicode selection

Move and replace selections by Unicode code point without splitting user-perceived text.

Move and replace selections by Unicode code point without splitting user-perceived text.

Current: 한글과 emoji 👋

Multiline

Edit multiple lines while preserving selection and composition state.

Edit multiple lines while preserving selection and composition state.

Current: Sectile

Controlled

Let the parent own the current value and apply accepted changes back to the component.

Let the parent own the current value and apply accepted changes back to the component.

Current: Sectile

Examples

Controlled IME

Type Korean text in a parent-controlled field, then press Tab during the final composition. The committed value updates once without duplicating the last syllable.

Type Korean text in a parent-controlled field, then press Tab during the final composition. The committed value updates once without duplicating the last syllable.

Current: Empty

API

Vue package: @sectile/vue/text

Components
  • TextField

Props

TextFieldProps

autocomplete

Native autocomplete hint forwarded to the editable input.

defaultValue

Initial value used when the component owns its state.

disabled

Whether interaction is unavailable.

form

ID of the native form associated with the control.

modelModifiers

Vue v-model modifiers applied to text updates.

modelValue

Current value when state is controlled by the parent.

multiline

Whether the text field renders a textarea.

name

Name used for native form submission.

placeholder

Text shown when no value has been entered.

readonly

Whether the value can be inspected but not changed.

required

Whether the control must contain a valid value before submission.

type

Selection or behavior mode used by the component.

Events

TextField

update:modelValue

Emitted when the component requests a new controlled value.

Other types

TextFieldModelModifiers

NameTypeRequired
lazyboolean
numberboolean
trimboolean

TextFieldValueChangeHandler

ts
type TextFieldValueChangeHandler = (value: string | number) => void

Parts

Shared scope: [data-scope="text"]. Combine it with a part selector to keep styles local to this component.

PartSelectorRoleExtra attributes
input[data-part="input"]Accepts the editable value or draft.

Keyboard interaction

KeyBehavior
Standard editing keysEdit and select text with the host input conventions.
TabCommit focus movement without replacing native text behavior.

Accessibility

The labeled input or textarea preserves native editing, selection, IME, disabled, and readonly semantics.

Released under the MIT License.