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

dealer-form-components

v1.0.4

Published

React and Astro form components for dealer websites

Downloads

29

Readme

Dealer Form Components

/
├── index.ts
├── src
│   ├── components
│   │   ├── astro 
│   │   │   ├── CheckBox.astro 
│   │   │   ├── Form.astro 
│   │   │   ├── FormSectionTitle.astro 
│   │   │   ├── Input.astro 
│   │   │   ├── Select.astro 
│   │   │   └── SuccessModal.astro
│   │   ├── react 
│   │   │   ├── CarSelects.tsx
│   │   │   ├── FileInput.tsx
│   │   │   ├── ReactInput.tsx
│   │   │   └── ReactSelect.tsx
│   └── utils.ts
├── tsconfig.json
└── package.json

The index.ts file is the "entry point" for your package. Export your components in index.ts to make them importable from your package.

Astro components

CheckBox

With label

---
import { CheckBox } from "dealer-form-components";
---

<CheckBox name="privacy_policy" label="Privacy Policy" />

With slot

---
import { CheckBox } from "dealer-form-components";
---

<CheckBox name="privacy_policy">
    I agree that I have read <a href="/privacy-policy" target="_blank">the privacy policy</a>
</CheckBox>

FormSectionTitle

---
import { FormSectionTitle } from "dealer-form-components";
---

<FormSectionTitle text="Contact Information" />

Select

---
import { Select } from "dealer-form-components";
---

<Select name="brand" label="Brand" required options={["Ford","Jeep","Kia"]} />

Input

---
import { Input } from "dealer-form-components";
---

<Input name="full_name" label="Full Name" type="text" required />

Form

Without reload

---
import { Form } from "dealer-form-components";
import Button from "./Button.astro";
---

<Form className="[...]">
    [...]
    <Button slot="submit-button"className="w-full">Send</Button>
</Form>

With reload

---
import { Form, FormSectionTitle, Input } from "dealer-form-components";
import Button from "./Button.astro";
---

<Form className="[...]" reload="true">
    <FormSectionTitle text="Contact Information" />
    <Input name="full_name" label="Full Name" required />
    <Input name="phone" type="tel" label="Phone" required />
    <Input name="email" type="email" label="Email" required />

    //Must be theme span for buttons
    <Button slot="submit-button">Send</Button>
</Form>

React Components

CarSelects

---
import { CarSelects } from "dealer-form-components";
---

<CarSelects client:visible required />

FileInput

---
import { FileInput } from "dealer-form-components";
---

<FileInput client:visible />

ReactInput

Component for inventory page

---
import { ReactInput } from "dealer-form-components";
---

<ReactInput name="name" onChangeValue={setName} activeInput={activeName} label="Name" required />

ReactSelect

Component for inventory page

---
import { ReactSelect } from "dealer-form-components";
---

<ReactSelect id='type' label="Type" data={data} value={value} handleChange={(n) => setTypeForm(parseInt(n.target.value))} dark={dark} />

Components params

CheckBox

| Param | Type | Required | | ----- | ---- | -------- | | label | string | optional | | name | string | optional |

Form

| Param | Type | Required | | ----- | ---- | -------- | | className | string | optional | | reload | string | optional | | slot | HTMLElement | optional | | slot - submit-button | HTMLElement | optional |

FormSectionTitle

| Param | Type | Required | | ----- | ---- | -------- | | text | string | required |

Input

| Param | Type | Required | Default | | ----- | ---- | -------- | ------ | | label | string | required | | | type | "text", "date","time","tel","email" | optional | text | | name | string | optional | input | | required | boolean | optional | true | | value | string | optional | |

Select

| Param | Type | Required | Default | | ----- | ---- | -------- | ------ | | label | string | required | | | options | Array | optional | | | name | string | optional | select | | required | boolean | optional | true |

CarSelects

| Param | Type | Required | | ----- | ---- | -------- | | required | boolean | optional |

FileInput

No params

ReactInput

| Param | Type | Required | Default | | ----- | ---- | -------- | ------ | | label | string | required | | | name | string | required | input | | required | boolean | required | false | | type | string | optional | text | | onChangeValue | ()=>void | optional | | | activeInput | boolean | optional | false |

ReactSelect

| Param | Type | Required | | ----- | ---- | -------- | | label | string | required | | options | Array | required | | key | string | optional | | onChangeValue | ()=>void | optional |

Functions

submitForm

In astro components add this script

<script>
    import { actions, isInputError } from 'astro:actions';
    import { submitForm } from 'dealer-form-components';
    const formAction = actions.myAction;
    submitForm(formAction, isInputError);
</script>

Actions required

1. Include files for package to be included in bundler:

export default {
	content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}',  "./node_modules/dealer-form-components/src/**/*.{astro,js,jsx,ts,tsx}"],
    theme: {
        ...
    }
}

2. Add custom color:

In tailwind.config.mjs add this custom colors:

export default {
	theme: {
        extend: {
            colors: {
                // add error color
                "error-color": ...,
                // add accent color
                "accent-color": ...
            }
        }
    }
}

3. Add section title font size:

In tailwind.config.mjs add this custom color:

export default {
	theme: {
        extend: {
            // add font size
            fontSize: {
                "section-title": ...
            }
        }
    }
}