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

react-ai-config-helper

v0.1.0

Published

A React component for AI-assisted field configuration

Readme

React AI Config Helper

A React component for AI-assisted field configuration in forms. This package provides a chat-like interface that can be attached to any form field to offer AI-powered assistance.

npm version License

Features

  • 🤖 AI-powered field configuration assistance
  • 💬 Chat interface for interacting with the AI
  • 🎯 Easily attach to any form field
  • 🎨 Customizable styling
  • 📋 One-click value application
  • 🔌 Plug in your own AI service or use mock responses

Installation

# npm
npm install react-ai-config-helper

# yarn
yarn add react-ai-config-helper

Peer Dependencies

This package requires the following peer dependencies:

react: ^17.0.0 || ^18.0.0
react-dom: ^17.0.0 || ^18.0.0
@mui/material: ^5.0.0
@mui/icons-material: ^5.0.0
@emotion/react: ^11.0.0
@emotion/styled: ^11.0.0

Usage

Basic Usage

import { AiConfigHelper } from "react-ai-config-helper";
import { TextField } from "@mui/material";

function MyForm() {
  const [value, setValue] = React.useState("");

  return (
    <div style={{ position: "relative" }}>
      <TextField
        label="Notes"
        value={value}
        onChange={(e) => setValue(e.target.value)}
        fullWidth
        InputProps={{
          endAdornment: (
            <AiConfigHelper
              fieldId="notes"
              fieldName="Notes"
              onApplyValue={(newValue) => setValue(newValue)}
            />
          ),
        }}
      />
    </div>
  );
}

With JSON Editor

import { AiConfigHelper } from "react-ai-config-helper";
import { JsonEditor } from "your-json-editor-library";

function MyJsonForm() {
  const [schema, setSchema] = React.useState({ type: "object" });

  return (
    <div>
      <div style={{ display: "flex", alignItems: "center" }}>
        <label>JSON Schema</label>
        <AiConfigHelper
          fieldId="schema"
          fieldName="JSON Schema"
          onApplyValue={(newValue) => setSchema(newValue)}
        />
      </div>
      <JsonEditor
        value={schema}
        onChange={(newSchema) => setSchema(newSchema)}
      />
    </div>
  );
}

With Custom API Integration

import { AiConfigHelper } from "react-ai-config-helper";

function MyFormWithCustomAI() {
  const [value, setValue] = React.useState("");

  // Define your custom API handler
  const handleSendMessage = async (message) => {
    // Call your AI service
    const response = await fetch("https://your-ai-service.com/api", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ query: message, fieldType: "text" }),
    });

    const data = await response.json();

    // Return in the expected format
    return {
      payload: data.suggestion,
    };
  };

  return (
    <div>
      <TextField
        label="Custom Field"
        value={value}
        onChange={(e) => setValue(e.target.value)}
        InputProps={{
          endAdornment: (
            <AiConfigHelper
              fieldId="custom"
              fieldName="Custom Field"
              onApplyValue={(newValue) => setValue(newValue)}
              onSendMessage={handleSendMessage}
              welcomeMessage="Hello! I'm your custom AI assistant. How can I help you today?"
            />
          ),
        }}
      />
    </div>
  );
}

Props

| Prop | Type | Default | Description | | ----------------- | -------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------ | | fieldId | string | (required) | Unique identifier for the field | | fieldName | string | (required) | Display name of the field to show in the helper | | onApplyValue | function | undefined | Callback for when a value is selected to be applied | | placement | "top" | "bottom" | "left" | "right" | "right" | Position of the helper popover relative to the trigger | | icon | ReactNode | <HelpOutlineIcon /> | Custom icon to use for the helper trigger button | | onSendMessage | function | undefined | Custom function to handle API requests | | welcomeMessage | string | "Hi there! I'm AiConfigHelper. How can I help you configure the [fieldName] field?" | Custom welcome message | | helpButtonLabel | string | "Get AI assistance" | Custom button text for the help button | | styles | object | {} | Custom styles for the component |

Styles Object Properties

| Property | Type | Default | Description | | ----------------------- | ------ | -------------- | ------------------------------------------ | | width | number | 320 | Width of the chat popup in pixels | | maxHeight | number | 400 | Maximum height of the chat popup in pixels | | userMessageColor | string | "primary.main" | Background color of user messages | | userMessageTextColor | string | "white" | Text color of user messages | | assistantMessageColor | string | "grey.100" | Background color of assistant messages |

License

MIT