npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@970design/vue-gravity-forms

v1.3.0

Published

A Vue component for interacting with Gravity Forms in a headless WordPress environment.

Readme

What is Vue Gravity Forms?

Vue Gravity Forms is a Vue 3 component which allows you to render and process Gravity Forms in a headless WordPress environment via the Companion WordPress Plugin. This component will work in any environment where Vue is supported (such as Astro.js). Currently, it supports all Basic and Advanced field types, confirmation messages and redirects, file uploads, multipage forms, and (optionally) Google reCAPTCHA v3.

Setup Guide

  • Install and activate the Gravity Forms plugin in your headless WordPress site, and create a form.
  • Install and active the companion Vue Gravity Forms Plugin in your headless WordPress site, configure it with your allowed origins and get your API Key.
  • Install this package in your front-end project using npm (or your favorite package manager):
    • npm install @970design/vue-gravity-forms
  • Import and use the VueGravityForms component in your front-end project, passing the required props (see example below) - including the apiKey which is provided by the companion WordPress plugin.

Example Usage (with Astro.js)

---
import VueGravityForms from "@970design/vue-gravity-forms";

const formId = 1;
const endpoint = 'https://my-headless-wordpress.com';
const apiKey = import.meta.env.GF_API_KEY;
---

<VueGravityForms
    client:load
    formId={formId}
    endpoint={endpoint}
    apiKey={apiKey}
    recaptchaKey="OPTIONAL_RECAPTCHA_KEY"
/>

You can also include our default styling by importing the CSS file:

import '@970design/vue-gravity-forms/dist/style.css';

Props

| Prop | Type | Required | Description | |------|------|----------|------------------------------------------------------| | endpoint | string | Yes | The base URL of your headless WordPress site | | formId | number | Yes | The ID of the Gravity Form to display | | apiKey | string | Yes | API Key generated by the companion WordPress plugin. | | recaptchaKey | string | No | Google reCAPTCHA v3 site key (enabled if passed) | | customComponents | object | No | Object containing custom field components to override defaults |

Custom Components

You can override any default form field component by passing custom components through the customComponents prop. This allows you to customize the appearance and behavior of specific field types while maintaining the form's functionality.

Example Usage

<VueGravityForms 
    :formId="formId" 
    :endpoint="endpoint" 
    :apiKey="gfApiKey"
    :recaptchaKey="recaptchaKey"
    :customComponents="{ 
        text: CustomTextField, 
        textarea: CustomTextareaField 
    }"
/>

Available Field Types for Override

| Field Type | Component Name | |------------|----------------| | text | TextField | | textarea | TextareaField | | select | SelectField | | multiselect | MultiselectField | | radio | RadioField | | checkbox | CheckboxField | | datetime | DateTimeField | | hidden | HiddenField | | fileupload | FileUploadField | | section | SectionBreakField | | address | AddressField | | image_choice | ImageChoiceField | | name | NameField |

Custom Component Interface

Custom components must implement the following props interface:

interface FieldComponentProps {
    field: Object // The field configuration object 
    modelValue: string // The field's current value (v-model) 
    formId: string|number // The form ID 
    errorMessage: string // Error message if validation fails 
    hasError: boolean // Whether the field has an error 
}

Conditional Logic

As of the latest release, Conditional Logic is fully supported.
Fields, sections, and pages will automatically show or hide based on their defined Gravity Forms logic rules — no additional setup is required.

This logic is handled reactively in Vue using the useConditionalLogic composable, ensuring seamless updates as users interact with the form.

Feature Roadmap

  • ~~Support for overriding field components~~
  • ~~Support for multipage forms~~
  • ~~Support for Conditional Logic~~
  • Support for Post fields
  • Support for Pricing fields
  • Support for Gravity Forms Add-Ons (e.g. User Registration, etc)

More Information

The development of this package is sponsored by 970 Design, a creative agency based in Vail, Colorado. If you need help with your headless WordPress project, please don't hesitate to reach out.