1.1.0 • Published 11 months ago

dry-components v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

dry-components

A lightweight React component library built with Tailwind CSS for styling. This library contains a collection of reusable components, making it easy to integrate into your projects.

Features

  • Built using JSX
  • Styled with Tailwind CSS
  • Simple and reusable component structure
  • Customizable with Tailwind CSS classes

Installation

First, install the library via npm:

npm install dry-components

Usage

To use any component from the library, import it into your project like so:

import { Input } from 'dry-components';
import { TextArea } from 'dry-components';
import { SelectInput } from 'dry-components';
import { PrimaryButton } from 'dry-components';

Input Component Props

Prop NameTypeRequiredDescription
valuestringYesThe current value of the input field.
namestringYesThe name of the input field. Typically used for form handling.
typestringYesThe type of the input (e.g., text, password, email, etc.).
handleChangefunctionYesThe function to handle the change event for the input field.
widthstringNoOptional width of the input container, default is w-full. Accepts Tailwind CSS width classes.
labelstringNoPlaceholder text for the input field. If not provided, the placeholder will be empty.

TextArea Component Props

Prop NameTypeRequiredDescription
valuestringYesThe current value of the text area.
namestringYesThe name of the text area. Typically used for form handling.
typestringNoThe type of the text area (not commonly used for textarea, but included for consistency).
handleChangefunctionYesThe function to handle the change event for the text area.
widthstringNoOptional width of the text area container, default is w-full. Accepts Tailwind CSS width classes.
labelstringNoPlaceholder text for the text area. If not provided, the placeholder will be empty.
rowsnumberNoNumber of visible text lines. Defaults to 5.

SelectInput Component Props

Prop NameTypeRequiredDescription
valuestringYesThe current value of the selected option.
namestringYesThe name of the select input. Typically used for form handling.
optionsArray<{ value: string, label: string }>YesArray of option objects where each object has a value and a label property.
handleChangefunctionYesThe function to handle the change event for the select input.
widthstringNoOptional width of the select input container, default is w-full. Accepts Tailwind CSS width classes.
labelstringNoPlaceholder text for the select input. This will be shown as a disabled option when no option is selected.

PrimaryButton Component Props

Prop NameTypeRequiredDescription
labelstringYesThe text to display inside the button.
onClickfunctionYesThe function to call when the button is clicked.
widthstringNoOptional width of the button container, default is w-fit. Accepts Tailwind CSS width classes.
variantstringNoThe button style variant. Options include outlined and default (filled).
1.0.2

11 months ago

1.1.0

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.1

1 year ago

1.0.0

1 year ago