-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormKit
Integration
#4
Comments
Not sure if this is something for this library or whether some integrating code should be added in FormKit, but I'd welcome this kind of integration or some kind of API for component libraries. |
@danielroe It could be a separate module. But since the component lives here you could possibly check to see if the I am just thinking out-loud. Maybe it's more complex than I am making it sound :) I appreciate the instant feedback! let me know where I could help. Thanks 馃挌 |
Well, a good start would be a sample project with both |
I got you thanks! |
Hey @danielroe, this feature is something that I like to have in my project. If you need a sponsor to do that, how much will be (remember that I'm just a solo dev hahaha)? |
Sponsorship is always welcome 馃槉 but I'm happy to implement this anyway when I have time. The first thing to do would be to spell out a little bit more of the kind of API/experience you're looking for as a user of FormKit. Make that as high-level as you like. |
Today I'm using FormKit for the forms and NaiveUI for the components, until I have time to create my own components, but I'll keep using FormKit because forms are hard work that I'm not following to self-made. With that in mind, I'm using your module easily, but an auto import with, I don't know, little config on nuxt.config or some prop in FormKit form type will be awesome (but not sure if it's really can be reach from FK side). If not, just a (I'm having a problem with this lib on nuxt.config, that cannot set theme option, but since it's not my main concern yet, I just commented out for now) |
Hi, I haven't made use of this project yet but I would think that integrating with FormKit may not be its scope. Instead, FormKit does make it very easy to add custom inputs. This is how I would do it:
<script setup>
const props = defineProps({
context: Object,
})
function handleInput(token) {
props.context.node.input(token)
}
</script>
<template>
<Turnstile v-model="props.context._value" @update:modelValue="handleInput" />
</template>
import { createInput } from '@formkit/vue';
import FKTurnstile from '~/components/FKTurnstile.vue';
export default {
inputs: {
turnstile: createInput(FKTurnstile, {})
},
}; Here's a stackblitz with this: https://stackblitz.com/edit/github-ryz8tl?file=app.vue (may get deleted later); feel free to share any improvements you think can be added. |
馃啋 Your use case
When integrating with FormKit you can add custom inputs which in this case it would be nice to see examples on how to best integrate with FormKit. I would like to have the option to just a make a new input and add the captcha to the form automatically. FormKit is a super nice library for validation creation of forms.
FormKit
馃啎 The solution you'd like
I would like to see if formkit is enabled it automatically registers a new
FormKit
type ofturnstile
if that is possible.馃攳 Alternatives you've considered
No response
鈩癸笍 Additional info
Links & Context
It would be awesome to integrate globally so it can be easier to use.
The text was updated successfully, but these errors were encountered: