{"id":22862831,"url":"https://github.com/funyin/formvalidator","last_synced_at":"2025-04-30T21:52:52.780Z","repository":{"id":40323857,"uuid":"448129951","full_name":"funyin/FormValidator","owner":"funyin","description":"A form validation library for android jetpack compose","archived":false,"fork":false,"pushed_at":"2023-12-15T08:29:38.000Z","size":134,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T21:52:45.397Z","etag":null,"topics":["jetpack-compose","validation-library"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funyin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-14T23:00:17.000Z","updated_at":"2024-09-28T14:39:45.000Z","dependencies_parsed_at":"2022-08-09T17:20:28.914Z","dependency_job_id":null,"html_url":"https://github.com/funyin/FormValidator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funyin%2FFormValidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funyin%2FFormValidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funyin%2FFormValidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funyin%2FFormValidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funyin","download_url":"https://codeload.github.com/funyin/FormValidator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251789310,"owners_count":21644081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jetpack-compose","validation-library"],"created_at":"2024-12-13T10:15:41.675Z","updated_at":"2025-04-30T21:52:52.736Z","avatar_url":"https://github.com/funyin.png","language":"Kotlin","readme":"# FormValidator [![](https://jitpack.io/v/funyin/FormValidator.svg)](https://jitpack.io/#funyin/FormValidator) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FormValidator-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/8353) [![Made in Nigeria](https://img.shields.io/badge/made%20in-nigeria-008751.svg?style=flat-square)](https://github.com/acekyd/made-in-nigeria)\nA form validation library for android jetpack compose\n\n## Features\n- Determine Validation Flow.\n    __Flow.Down__|__Flow.Up__|__Flow.Splash__\n- Custom Validation\n- Validation Snackbar\n- Validation State Callbacks\n- Library is well documented\n\n## Preview\n\n\nhttps://user-images.githubusercontent.com/38915569/149603789-1f47436b-b8f9-44a6-98a6-6ec389a75e7b.mp4\n\n\n\n## Example\n```kotlin\n@Composable\n    fun ScreenContent() {\n        var name by remember { mutableStateOf(\"\") }\n        var nameError by remember { mutableStateOf\u003cString?\u003e(null) }\n        var email by remember { mutableStateOf(\"\") }\n        var emailError by remember { mutableStateOf\u003cString?\u003e(null) }\n        val nameField = \"Name\"\n        val emailField = \"Email\"\n        val validator = FormValidator(\n            fields = listOf(\n                ValidationField(\n                    value = name,\n                    name = nameField,\n                    onError = {\n                        nameError = it\n                    }),\n                ValidationField(\n                    value = email,\n                    onError = {\n                        emailError = it\n                    }, type = FormValidator.Type.Email\n                )\n            )\n        )\n        Form(\n            validator = validator,\n            modifier = Modifier\n                .fillMaxSize()\n                .verticalScroll(state = rememberScrollState())\n                .padding(16.dp)\n        ) {\n            Spacer(modifier = Modifier.height(30.dp))\n            AppTextField(\n                label = nameField,\n                value = name,\n                placeholder = \"Enter name\",\n                onValueChanged = { name = it },\n                errorMessage = nameError\n            )\n            Spacer(modifier = Modifier.height(16.dp))\n            AppTextField(\n                label = emailField,\n                value = email,\n                placeholder = \"Enter email\",\n                onValueChanged = { email = it },\n                errorMessage = emailError,\n                keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email)\n            )\n            Spacer(modifier = Modifier.height(40.dp))\n            AppButton(text = \"Submit\") {\n                if(validator.validate())\n                    showToast(validator.errorMessage)\n            }\n        }\n    }\n```\n\n## Getting started\n### Step 1. Add the JitPack repository to your build file\n```gradle\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\n### Step 2. Add the dependency\n```gradle\ndependencies {\n\t        implementation 'com.github.funyin:FormValidator:1.0.0'\n\t}\n```\n\n[![BuyMeAShawrma.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1619907239535/KqJOyu-70.png)](https://www.buymeacoffee.com/funyinkash) \n","funding_links":["https://www.buymeacoffee.com/funyinkash"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunyin%2Fformvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunyin%2Fformvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunyin%2Fformvalidator/lists"}