Phone Field
A phone number field. The handset nods as you type and rings when the number is complete.
Get the file
Runtime
.rivReady to use in your app or website.
$4.99
Editable
.rev + .rivOpen it in the Rive editor and change anything. The .riv is included.
$9.99

Learn to build it
Full accessBuild this yourself, step by step. Every file in the library is included.
Courses from $119
Own a course? Sign in and every file is yours.
Use it in your own products and client work. Please don't resell or share the files themselves.
Using this file
The licence →Can I use it in a commercial product or a client project?
Yes. Use it in your own apps, websites and games, and in work you do for clients, paid or not. Change it as much as you like. Read the full licence
Can I resell or share the file?
No. Please don't resell, redistribute or re-upload the files, as they are or changed, and don't bundle them into templates, asset packs or UI kits, free or paid. If someone wants one, share a link to this page instead. Read the full licence
Do I need to credit you?
No, credit isn't required. A mention or a link back is always appreciated, though. Read the full licence
What's the difference between the .riv and the .rev?
The .riv is the runtime file: it goes into your app or website and plays there. The .rev is the editable source: you open it in the Rive editor to change the design, the animation or the state machine, then export your own .riv. Read the full licence
I own a course. Do I get it?
Yes. If you own the Rive Masterclass or the Rive Scripting Course, every file in the library is yours, the .riv and the .rev. Sign in with the email you bought the course with and the downloads unlock. Read the full licence
Who owns the files?
The files stay © Tom Acco / Rive Masterclass. When you download or buy one, you get a licence to use it, not ownership of it. Read the full licence
Use it on your site
import { useRive } from '@rive-app/react-canvas';
export function PhoneField() {
const { rive, RiveComponent } = useRive({
src: '/form-phone.riv',
artboard: 'Phone Field',
stateMachines: 'State Machine 1',
autoplay: true,
autoBind: true,
});
// every input on this page is a view model property
const vm = rive?.viewModelInstance;
if (vm) vm.color('iconColor').value = 0xFF745FF8;
return <RiveComponent style={{ width: '100%', height: 400 }} />;
}Inputs: text, placeholder, fontSize, disabled, boxColor, borderColor, focusColor, textColor, placeholderColor, disabledColor, digits, iconColor, successColor, sparkles. All on the PhoneField view model.
How it's built
From the Form Set: a text field for phone numbers. Every key gives the handset a little nod. Once the number has enough digits the phone rings, the border turns green, a ring goes off and (if you want it) a small burst of sparks. Set how many digits make a full number, read valid in your app, and pick the box, border, text, icon and success colours. It stretches to any width, and disabled greys it out and ignores taps.
- 1Real typingIt is Rive's own text input, so it gets focus, a caret and the keyboard. What the user types lands in text, and focused tells you when it is active.
- 2Count the digitsA tiny script counts the digits in text (spaces, dashes and brackets are fine) and sets valid once there are at least digits of them. That is all the script does.
- 3Ring, then celebratevalid plays one timeline: the handset wiggles with sound waves, then hops, a ring goes off and the border turns successColor. Delete a digit and it calms down. All plain timelines you can open and edit.
- 4A nod per keyA listener on text fires a small nod every time the text changes, so the phone reacts to each key without anything extra in the view model.



