VIRASTACKMask
  • Hakkında
  • Katkı
ViraStack Mask

Başlangıç

  • Giriş
  • llms.txt

Kullanım

  • useViraMask()
  • Özel maske
  • Validation
  • Helpers
  • Types
  • UI kütüphaneleri

Örnekler

  • Tümü
  • Alpha
  • CVV
  • E-posta
  • IBAN
  • Kart
  • Kredi kartı formu
  • Kullanıcı adı
  • Metin
  • Para birimi
  • Parola
  • Posta kodu
  • Sayısal
  • Son kullanma
  • Tarih
  • TCKN
  • Telefon
  • URL
  • Vergi no (VKN)

Telefon

Varsayılan NANP tarzı telefon: (999) 999-9999.

← Tüm örnekler·phone

Önizleme

rawValue: —

value: —

import { useForm } from "react-hook-form"
import { useViraMask } from "@virastack/mask"
 
function Example() {
  const form = useForm<{ phone: string }>()
  const { phone } = useViraMask({
    form,
    schema: { phone: "phone" },
  })
 
  const { rawValue, ...inputProps } = phone
 
  return <input {...inputProps} placeholder="(555) 555-5555" />
}

Detaylar

  • Maske: (999) 999-9999
  • Hazır maske: "phone"
  • Yaygın uluslararası gruplama varsayılandır. Yerleşik format doğrulayıcısı yoktur; yalnızca maske uygulanır.

Özelleştirme

Türkiye telefon özelleştirme

TR için boşluklu gruplamayı mask override ile kullanın.

rawValue: —

value: —

import { useForm } from "react-hook-form"
import { useViraMask } from "@virastack/mask"
 
const form = useForm({ defaultValues: { phone: "" } })
 
const { phone } = useViraMask({
  form,
  schema: {
    phone: {
      preset: "phone",
      mask: "(999) 999 99 99",
    },
  },
})
 
const { rawValue, ...inputProps } = phone
 
<input {...inputProps} placeholder="(555) 555 55 55" />

Hook API için useViraMask(), özel maske için custom mask.

ÖncekiTCKNSonrakiURL

Bu sayfada

  • Önizleme
  • Detaylar
  • Özelleştirme
Hata mı var? Düzeltin