Inputs

Text field

The foundation of every form: a labelled single-line input with filled and outlined surfaces, leading and trailing slots, helper text, and error states connected to the theme.

We only use it to send the invite

At least 8 characters

Playground

Configure the complete public surface and copy synchronized kebab-case markup.

Interactive preview

Changes are reflected in the example and source.

We only use it to send the invite

Properties

Label

Names the field

Variant

Filled or outlined surface

Type

Native input type

Icon slot

Leading or trailing glyph

Helper text

Supporting guidance under the field

State

Interactive state flags

Vue

<m-text-field
  v-model="value"
  label="Work email"
  helper-text="We only use it to send the invite"
>
  <template #prepend>
    <m-icon name="ic:round-mail-outline" />
  </template>
</m-text-field>

Token map

Inspect how the field's component tokens map onto system tokens across variants and states.

MTextField · All91 tokens
md-text-field

MTextField API

Props, slots, and events are hydrated from the generated public manifest.

MTextField

Field family
src/runtime/components/ui/text-field

Props

NameTypeDefault
disabledPrevents interaction and applies the disabled visual state.
booleanfalse
loadingReplaces content with progress feedback and prevents interaction.
booleanfalse
readonly
booleanfalse
variant
'filled' | 'outlined' | 'underline''filled'
rounded
'sharp' | 'small' | 'medium' | 'large' | 'pill''small'
labelPlacement
'top' | 'float' | 'inset' | 'hidden''float'
path
stringundefined
name
stringundefined
label
stringundefined
placeholder
stringundefined
helperText
stringundefined
error
booleanfalse
errorMessage
stringundefined
required
booleanfalse
autofocus
booleanfalse
autocomplete
stringundefined
density
'compact' | 'default' | 'comfortable''default' as MFieldDensity
type
'text' | 'number' | 'email' | 'password''text'
inputAttrsNative input attributes/listeners used by composite fields such as comboboxes.
InputHTMLAttributesundefined
populatedForce the floating label into its raised position regardless of the text value. Composite fields (e.g. a multiple combobox) set this while chips occupy the field but the text draft is empty, so the label does not drop back onto them on blur.
booleanfalse

Slots

Events

MTextField does not emit component-specific events. Native events fall through to its root element.