This would be done via the base framework’s solution. If you are using Angular, you can use Reactive Forms to do this. Assume Vue and React have similar solutions. There are tons of tutorials on this.
Remember, Ionic is just the UI layer, the business logic (like validation) lives with the framework (Angular).
Vue does have similar solution to validation. There are plugins like Vuetify, vee validation, and vue form generator that can be used for vue validation.