
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
A modern, accessible React form components library with built-in validation support.
npm install headsup-ui
# Peer dependencies
npm install react react-dom
npm install clsx tailwind-merge lucide-react
CustomInput: Text, email, password, number inputs with various featuresCustomTextarea: Multiline text input with character countingCustomCheckbox: Boolean input with label supportCustomRadio: Radio button for selecting from optionsCustomSwitch: Toggle switch for boolean settingsimport React, { useState } from 'react';
import {
CustomInput,
CustomTextarea,
CustomCheckbox,
CustomRadio,
CustomSwitch
} from 'headsup-ui';
function MyForm() {
const [formValues, setFormValues] = useState({
name: '',
email: '',
message: '',
agreeToTerms: false,
contactMethod: '',
notifications: true
});
const handleSubmit = (e) => {
e.preventDefault();
console.log(formValues);
};
return (
<form onSubmit={handleSubmit} className="space-y-4">
<CustomInput
name="name"
label="Full Name"
placeholder="John Doe"
values={formValues}
setValues={setFormValues}
clearable
/>
<CustomInput
name="email"
label="Email Address"
type="email"
placeholder="john@example.com"
values={formValues}
setValues={setFormValues}
caseSensitive={false}
clearable
/>
<CustomTextarea
name="message"
label="Your Message"
rows={5}
placeholder="Type your message here..."
values={formValues}
setValues={setFormValues}
maxLength={500}
showCounter
/>
<div className="space-y-2">
<h3 className="text-sm font-medium">Preferred Contact Method</h3>
<CustomRadio
name="contactMethod"
label="Email"
value="email"
values={formValues}
setValues={setFormValues}
/>
<CustomRadio
name="contactMethod"
label="Phone"
value="phone"
values={formValues}
setValues={setFormValues}
/>
</div>
<CustomSwitch
name="notifications"
label="Enable Notifications"
values={formValues}
setValues={setFormValues}
/>
<CustomCheckbox
name="agreeToTerms"
label="I agree to the Terms and Conditions"
values={formValues}
setValues={setFormValues}
/>
<button type="submit" className="px-4 py-2 bg-blue-600 text-white rounded">
Submit
</button>
</form>
);
}
const [formValues, setFormValues] = useState({
profile: {
firstName: '',
lastName: '',
bio: ''
}
});
// In your JSX:
<CustomInput
name="firstName"
parent="profile"
label="First Name"
values={formValues}
setValues={setFormValues}
/>
const [formValues, setFormValues] = useState({
addresses: [
{ street: '', city: '', zipCode: '' },
{ street: '', city: '', zipCode: '' }
]
});
// In your JSX:
<CustomInput
name="street"
parent="addresses"
index={0}
label="Street (Home)"
values={formValues}
setValues={setFormValues}
/>
<CustomInput
name="street"
parent="addresses"
index={1}
label="Street (Work)"
values={formValues}
setValues={setFormValues}
/>
import { useDispatch, useSelector } from 'react-redux';
import { updateFormData } from './formSlice';
function ReduxForm() {
const dispatch = useDispatch();
const formValues = useSelector(state => state.form.data);
return (
<CustomInput
name="username"
label="Username"
values={formValues}
setValues={updateFormData}
useRedux={true}
dispatch={dispatch}
/>
);
}
import { validationSchema, useValidation } from '@sk2you/schema-validator';
// Define validation schema
const formSchema = {
username: validationSchema.string()
.required('Username is required')
.min(3, 'Username must be at least 3 characters'),
email: validationSchema.string()
.required('Email is required')
.regex(
/^[a-zA-Z0-9](?:[a-zA-Z0-9._%+-]*[a-zA-Z0-9])?@[a-zA-Z0-9](?:[a-zA-Z0-9.-]*[a-zA-Z0-9])?(?:\.[a-zA-Z]{2,})+$/,
'Invalid email format'
),
password: validationSchema.string()
.required('Password is required')
.min(8, 'Password must be at least 8 characters')
};
// In your component
const { errors, validate, validateAll } = useValidation(formSchema);
// In your JSX
<CustomInput
name="username"
label="Username"
values={formValues}
setValues={setFormValues}
error={errors}
validate={validate}
caseSensitive={false}
/>
// On form submission
const handleSubmit = (e) => {
e.preventDefault();
const isValid = validateAll(formValues);
if (isValid) {
console.log('Form is valid:', formValues);
// Submit form data
}
};
<CustomInput
name="email"
label="Email Address"
values={formValues}
setValues={setFormValues}
// Override specific class names
overrideClass={{
labelClassName: 'text-purple-700 font-bold',
inputClassName: 'bg-purple-50 border-purple-300 focus:border-purple-500',
helperClassName: 'text-purple-500 italic'
}}
/>
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | (required) | Field name |
label | string | undefined | Label text |
type | string | 'text' | Input type (text, email, password, etc.) |
keyboardType | string | undefined | Mobile keyboard type |
values | object | {} | Form values object |
setValues | function | (required) | Function to update form values |
parent | string | undefined | Parent object for nested fields |
index | number | undefined | Array index for array fields |
useRedux | boolean | false | Whether to use Redux |
dispatch | function | undefined | Redux dispatch function |
helperText | string | undefined | Helper text displayed below input |
error | object | undefined | Error object from validation |
errorText | string | undefined | Error text to display |
placeholder | string | undefined | Input placeholder |
clearable | boolean | false | Whether input should have a clear button |
showCounter | boolean | false | Whether to show character counter |
maxLength | number | undefined | Maximum input length |
disabled | boolean | false | Whether input is disabled |
className | string | '' | Additional CSS class |
onChange | function | undefined | Additional onChange handler |
validate | function | undefined | Validation function |
caseSensitive | boolean | true | Whether input should be case-sensitive |
overrideClass | object | {} | Class name overrides |
Similar to CustomInput with additional properties:
| Prop | Type | Default | Description |
|---|---|---|---|
rows | number | 4 | Number of visible text rows |
Similar to CustomInput but specifically for boolean values.
Similar to CustomInput with additional properties:
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | (required) | Radio button value |
Similar to CustomCheckbox but with a toggle switch UI.
HeadsUp UI components are built with Tailwind CSS. To customize the appearance, you can:
overrideClass propclassName prop to add additional classes to the containertailwind.config.js to change colors, sizes, etc.// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: {
50: '#f0f9ff',
100: '#e0f2fe',
// ...
600: '#0284c7',
// ...
},
},
},
},
}
HeadsUp UI is built with TypeScript and includes type definitions for all components and props.
import { CustomInputProps } from 'headsup-ui';
// Use types directly
const MyInput: React.FC<Omit<CustomInputProps, 'values' | 'setValues'>> = (props) => {
// Implementation
};
HeadsUp UI supports all modern browsers, including:
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
HeadsUp UI is developed and maintained by [Your Name/Company].
Special thanks to:
FAQs
A modern, accessible UI component library for React forms
The npm package headsup-ui receives a total of 6 weekly downloads. As such, headsup-ui popularity was classified as not popular.
We found that headsup-ui demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.