Breakdance supports input masks for Text fields in the Form Builder through the integrated Maska library. Input masks enforce consistent formatting for user input—ideal for fields like phone numbers, IP addresses, postal codes, and national identifiers.
| Token | Description | Example Mask | Example Input |
|---|---|---|---|
| # | Digit (0–9) | ###-### | 123-456 |
| 0 | Optional digit | +1 (###) ###-###0 | +1 (123) 456-7890 |
| 9 | Multiple digits | ###-###-9999 | 123-456-7890 |
| @ | Single letter (A–Z, a–z) | @#@ #@# | K1A 0B1 |
| z | Multiple letters (any case) | zzz | abc or XYZ |
| Z | Uppercase multiple letters | ZZZ | ABC |
| * | Letter or digit | ***-*** | A1B-2C3 |
| ! | Escape character | Invoice !#123 | Invoice #123 |
You can define multiple valid formats using an array of masks. The appropriate mask will be automatically chosen based on user input.
['###.###.###-##', '##.###.###/####-##']
123.456.789-1012.345.678/0001-90| Use Case | Mask Pattern | Example Input |
|---|---|---|
| Phone Number | +1 ### ###-##-## | +1 555 123-45-67 |
| Date | ##/##/#### | 31/12/2025 |
| Credit Card | #### #### #### #### | 4111 1111 1111 1111 |
| IP Address | #00.#00.#00.#00 | 192.168.001.001 |
| Year | #### | 2025 |
