
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@k8pai/tailwind-inputs
Advanced tools
Include tailwind configured form fields with validations in your React projects easily with tailwind-inputs, which utilizes ES6 imports that allows you to Manage validations and maintainability a piece of cake.
npm install @k8pai/tailwind-inputs --save
example usage
import { TiText } from '@k8pai/tailwind-inputs';
<TiText
name={'firstName'}
label={'First Name'}
value={firstName}
submit={submit}
onChange={(e) => setFirstName(e.target.value)}
validate="default"
errorMessage="This field should not be empty"
/>;
View the documentation for further usage examples and how to use tailwind-inputs.
| Key | Type | Default | Note |
|---|---|---|---|
name | String | null | Name of the input field |
label | String | null | Label For the input field |
value | state variable | null | Value of the input field |
submit | boolean | false | Form Submission State, to check field validations |
onChange | setState function | null | Function to update value state variable |
validate | String | null | Can be set to validate fields |
errorMessage | String | | Custom Error message for validations |
className | String | | Can customize Fields with tailwind |
It's always painful to have a
import React, { useState } from 'react';
import { TiText, TiMail, TiPassword } from '@k8pai/tailwind-inputs';
function Form() {
const [submit, setSubmit] = useState(false);
const [formData, setFormData] = useState({
username: '',
email: '',
password: '',
});
const handleSubmit = (event) => {
event.preventDefault();
setSubmit(true);
// ... rest of your code goes here
};
const handleChange = (event) => {
const { name, value } = event.target;
setFormData((prevFormData) => ({
...prevFormData,
[name]: value,
}));
};
return (
<form onSubmit={handleSubmit}>
<TiText
name={'username'}
label={'Username'}
value={formData.username}
submit={submit}
onChange={handleChange}
validate="default"
/>
;
<TiMail
name={'email'}
label={'Mail'}
value={formData.email}
submit={submit}
onChange={handleChange}
validate="email"
/>
;
<TiPassword
name={'password'}
label={'Password'}
value={firstName}
submit={submit}
onChange={handleChange}
validate="password"
/>
;
</form>
);
}
TBD
MIT
FAQs
An Awesome Collection of Form Field components.
We found that @k8pai/tailwind-inputs demonstrated a not healthy version release cadence and project activity because the last version was released 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.