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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@easycontact/react

v0.2.1

Published

Drop-in contact form widget for EasyContactForm. Paste one component into any React or Next.js page.

Readme

@easycontact/react

Drop-in contact form widget for EasyContactForm. Paste one component into any React or Next.js page and you're done — no backend wiring, no email server, no Tailwind dependency.

npm i @easycontact/react
import { ContactForm } from '@easycontact/react';

export default function ContactPage() {
  return <ContactForm projectId="YOUR_PROJECT_TOKEN" />;
}

The widget posts to https://api.easycontactforms.com/form/submit by default and the submission shows up in your project's submissions table.


Full-page contact page

If the form is the entire content of a route — e.g. app/contact/page.tsx — add layout="page". The widget then wraps itself in a full-height centered section, so the form sits vertically centered and the footer lands at the natural bottom of the page (no awkward gap). Pass an optional heading and description to render a title block above the form:

<ContactForm
  projectId="YOUR_PROJECT_TOKEN"
  layout="page"
  heading="Get in touch"
  description="Questions, feedback, or just want to say hi? Send us a message."
/>

The default layout="inline" continues to render just the form, suitable for embedding inside an existing page section.

The vanilla <script> embed exposes the same controls via data attributes:

<div data-easycontact="YOUR_PROJECT_TOKEN"
     data-easycontact-layout="page"
     data-easycontact-heading="Get in touch"
     data-easycontact-description="Questions? Send us a message."></div>

Light / dark mode

The form ships with a light and a dark palette and picks the right one for every visitor. Choose the behavior per-form with the theme prop:

<ContactForm projectId="…" theme="auto"  />   {/* default — follow OS */}
<ContactForm projectId="…" theme="light" />   {/* force light */}
<ContactForm projectId="…" theme="dark"  />   {/* force dark */}

Both palettes have been chosen so labels, placeholders, error banners, and the success state stay readable in either mode. There is nothing extra to import.

Driving the form from your own theme switcher

If your site already has a light/dark toggle, pass the same value through:

const { theme } = useMyTheme(); // 'light' | 'dark'

<ContactForm projectId="…" theme={theme} />

Plain HTML / <script> tag

The script-tag embed exposes the same three modes via a data attribute on the mount node:

<div data-easycontact="YOUR_PROJECT_TOKEN"
     data-easycontact-theme="dark"></div>

<script src="https://api.easycontactforms.com/widget/embed.js" defer></script>

Omit data-easycontact-theme to default to auto.

Customizing styles

The widget renders inside a wrapper with the class .ecf-wrap. Both themes are driven by CSS variables (--ecf-bg, --ecf-fg, --ecf-primary, etc.) defined on that element, so you can tweak individual colors without forking the component:

/* Brand the submit button without touching the rest. */
.ecf-wrap { --ecf-primary: #e11d48; }

/* Or fine-tune just the dark palette. */
.ecf-wrap[data-theme="dark"] .ecf-button {
  box-shadow: 0 0 0 1px #f87171;
}

Inner elements have stable class names you can target:

| Element | Class | |----------------|------------------| | Wrapper | .ecf-wrap | | Field row | .ecf-field | | Label | .ecf-label | | Text input | .ecf-input | | Message field | .ecf-textarea | | Submit button | .ecf-button | | Error banner | .ecf-error | | Success state | .ecf-success |

The wrapper also exposes data-theme="auto" | "light" | "dark" so you can scope rules to a specific palette.


Props

| Prop | Type | Default | Notes | |---------------|-----------------------------------------|-----------------------------------|-------| | projectId | string | — | Required. The project token from your dashboard. | | theme | 'auto' \| 'light' \| 'dark' | 'auto' | Color palette. See above. | | layout | 'inline' \| 'page' | 'inline' | page fills the viewport vertically — use for dedicated contact routes. | | heading | string | — | Title rendered above the form in layout="page". | | description | string | — | Supporting line below the heading in layout="page". | | apiBase | string | https://api.easycontactforms.com| Override only when self-hosting. | | className | string | — | Extra class on the outer <form>. | | style | React.CSSProperties | — | Inline styles merged into the wrapper. | | onSuccess | (data: unknown) => void | — | Fired after a successful submission. | | onError | (error: Error) => void | — | Fired on validation/network failures. |