Learn how to include easily React tailwindcss in your project.
npm install react-tailwindcss-ts
import style in main file
@import 'react-tailwindcss-ts/dist/index.css';
import { RTButton } from "react-tailwindcss-ts";
import { RTButton } from "react-tailwindcss-ts";
function TypesExample() {
return (
<>
<RTButton name="Submit" type={'submit'} />
</>
);
}
export default TypesExample;
Name | Type | Default | Description |
---|---|---|---|
name*Required | string | Name of button | |
className | string | bg-indigo-700 hover:bg-indigo-900 |
Tailwindcss class for button color, Example: bg-red-700 hover:bg-red-900 ,bg-green-700 hover:bg-green-900 |
type | button | submit | reset |
buttonType | sm | md | lg |
onClick | function | Callback fired when a button is pressed | |
processing | boolean | false | For Proccess is running or not |
import { RTInput } from "react-tailwindcss-ts";
function TypesExample() {
return (
<>
<RTInput name="input" label="Password" type={'text'} placeholder="Password"/>
</>
);
}
export default TypesExample;
Name | Type | Default | Description |
---|---|---|---|
name*Required | string | Name of input field | |
className | string | For Extra Tailwindcss class | |
label | string | Lable of Input | |
type | text | password | |
placeholder | string | Placeholder of Input | |
onChange | function | Callback fired when a input is changed | |
id | string | Id of Input | |
formik | boolean | false | it's use for Formik validation field |