Skip to content

TextBox-DEMO


Standard

vue
<fv-TextBox></fv-TextBox>

Read-only

vue
<fv-TextBox v-model="readOnlyText" readonly></fv-TextBox>

With placeholder

vue
<fv-TextBox placeholder="Please enter the text here."></fv-TextBox>

With an icon

vue
<fv-TextBox icon="Search"></fv-TextBox>

With type

vue
<fv-TextBox icon="RevealPasswordMedium" type="password"></fv-TextBox>

With pattern

vue
<fv-TextBox pattern="[a-zA-Z]"></fv-TextBox>

TextBox-With Input Mask


Standard

vue
<fv-TextBox mode="mask"></fv-TextBox>

Customize

vue
<fv-TextBox v-model="maskValue" mode="mask" mask="Tel: +__ ___ - ____ - ____" flag="_"></fv-TextBox>
<p>{{maskValue}}</p>

Customize Flag

vue
<fv-TextBox v-model="maskValue" mode="mask" mask="mask: xx-xxx-xxxx-xxxx" flag="x"></fv-TextBox>

TextBox-Disabled


  1. Standard
vue
<fv-TextBox disabled></fv-TextBox>
  1. With Input Mask
vue
<fv-TextBox mode="mask" disabled></fv-TextBox>
  1. With placeholder
vue
<fv-TextBox placeholder="Please enter the text here." disabled></fv-TextBox>
  1. With underline
vue
<fv-TextBox underline disabled prefix="Disabled:"></fv-TextBox>

TextBox-With Limit


vue
<fv-TextBox maxlength="5" style="width: 120px;"></fv-TextBox>

TextBox-With Underline And Borderless


vue
<fv-TextBox underline prefix="Standard:" focusBorderColor="rgba(0, 90, 158, 1)"></fv-TextBox>

TextBox-With Prefix/Suffix


Prefix

vue
<fv-TextBox prefix="https://"></fv-TextBox>

Suffix

vue
<fv-TextBox suffix=".com"></fv-TextBox>

Prefix and Suffix

vue
<fv-TextBox prefix="https://" suffix=".com"></fv-TextBox>

TextBox-With Status


Warn

vue
<fv-TextBox placeholder="Warn text." status="warn"></fv-TextBox>

Correct

vue
<fv-TextBox placeholder="Correct text." status="correct"></fv-TextBox>

TextBox-RevealBorder

vue
<fv-TextBox placeholder="Please enter the text here." :revealBorder="true" borderColor="rgba(0, 0, 0, 0.01)" borderRadius="3" :isBoxShadow="true"></fv-TextBox>

TextBox-Customize


Customize border color

vue
<fv-TextBox placeholder="Please enter the text here." borderColor="rgba(0,153,204,1)" focusBorderColor="rgba(0,204,153,1)"></fv-TextBox>

Customize background

vue
<fv-TextBox placeholder="Please enter the text here." background="rgba(0,153,204,1)" borderColor="rgba(0,153,204,1)"></fv-TextBox>

TextBox-Dark Theme


vue
<div style="padding: 15px; background: black;">
    <fv-TextBox placeholder="Please enter the text here." theme="dark"></fv-TextBox>
    <fv-TextBox placeholder="Please enter the text here." disabled theme="dark" value="123"></fv-TextBox>
    <fv-TextBox placeholder="Please enter the text here." prefix="https://" suffix=".com" theme="dark"></fv-TextBox>
    <fv-TextBox placeholder="Please enter the text here." prefix="https://" suffix=".com" disabled theme="dark"></fv-TextBox>
    <fv-TextBox underline prefix="Standard:" theme="dark"></fv-TextBox>
    <fv-TextBox underline prefix="Standard:" disabled theme="dark"></fv-TextBox>
</div>

Properties


PropertyTypeRequiredDefaultDescription
modelValuestringNo''Using v-model binding input value
modestringNo'default'Choose TextBox mode
inputmodestringNo'text'Input mode. Options:numeric, tel, text, decimal, email, url
placeholderstringNo''Same as the native HTML input attribute.
typestringNo'text'Same as the native HTML input attribute.
maskstringNo'mask:___'The mask mode input template
flagstringNo'_'The mask mode input flag
patternstringNo'[Ss]*'See the TextBox pattern option.
inputRulesstringNo'[\S\s]*'See the TextBox inputRules option.
readonlybooleanNofalseSame as the native HTML input attribute.
maxlengthstringNo''Same as the native HTML input attribute.
prefixstringNo''Prefix.
suffixstringNo''Suffix.
leftIconstringNo''Left icon.
iconstringNo''Right icon.
iconForegroundstringNo''
underlinebooleanNofalseWhether to use the underline style for TextBox
backgroundstringNo''
borderWidthnumberNo1
borderColorstringNo''
focusBorderColorstringNo''
revealBorderColorbooleanNofalse
revealBackgroundColorbooleanNofalse
fontSizenumberNo13.3
fontWeightstringNo'normal'
foregroundstringNo''
textAlignstringNo'left'
borderRadiusnumberNo3See the TextBox borderRadius option.
isBoxShadowbooleanNofalseEnable TextBox shadow.
revealBorderbooleanNofalse
statusstringNo''Preset status border. Built-in values are warning and correct.
debounceDelaynumberNo300Debounced input delay.
disabledbooleanNofalse
cursorstringNo''
themestringNo'global'Theme style. Supports global, light, dark, system, and custom.
langstringNo"global"See the TextBox lang option.

Events


EventArgumentsDescription
keydownevent
keyupevent
changeevent
pasteevent
left-icon-clickevent
icon-clickevent
debounce-inputstringEmitted with debounced input content.

Slots


  1. left-icon
html
<template #left-icon>
   <i class="ms-Icon ms-Icon--Search"></i>
</template>
  1. icon
html
<template #icon>
   <i class="ms-Icon ms-Icon--Cancel"></i>
</template>

MIT Licensed