ViraStack
  • About
  • Support
HomeGet StartedExamples
ViraStack

A DX-first toolkit for frontend developers: starters, agent rules, form hooks, and a guide.

Products

  • ViraStack Start
  • ViraStack AI
  • ViraStack Mask
  • ViraStack Password
  • ViraStack Guide

Explore

  • About
  • Brand
  • Support

© 2026 ViraStack.

Open source · MIT

Examples

  • All
  • Alpha
  • Card
  • Credit card form
  • Currency
  • CVV
  • Date
  • Email
  • Expiry
  • IBAN
  • Numeric
  • Password
  • Phone
  • Tax number (VKN)
  • TCKN
  • Text
  • URL
  • Username
  • ZIP code

Expiry

MM/YY format. The month must be valid and the date must not be in the past.

← All examples·expiry

Preview

rawValue: -

value: -

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

Details

  • Mask: 99/99
  • Preset: "expiry"
  • Built-in validator: 'expiry' Produces a form error when an invalid value is entered.
  • Invalid months or past dates are not accepted.

See useViraMask() for the hook API and custom mask for custom masks.

PreviousEmailNextIBAN

On this page

  • Preview
  • Details
Something wrong? Fix it