0.0.17 • Published 12 months ago

base-components-ui v0.0.17

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Custom Components with addon Props applied with Tailwind CSS.

Our Custom component is a custom React component implemented with Tailwind CSS classes. It takes props defined in their respective interfaces and renders a component with different features based on the provided props.

Run Commands

To make sure all of our components render properly we need to add tailwindcss, postcss, and autoprefixer as our Dev dependencies:

To add them use the Commands:

  yarn add -D tailwindcss postcss autoprefixer

And then initialize your tailwind.config.js and postcss.config.cjs with:

  npx tailwindcss init -p

For more procedure of installation of Tailwind CSS, follow this link:

Install Tailwind CSS using Post CSS

To add this component through yarn run

  yarn add base-components-ui

To add this component through npm run

  npm i base-components-ui

API Reference

Button Component

    <Button
        selfLabel="Button"
        onClick={() => alert("helo")}
        className="bg-blue-500"
    />
ParameterTypeDescription
iconReact.ReactNodeoptional.
selfLabelstringoptional.
isloadingbooleanoptional.
iconClassNamestringoptional.
...propsDetailedHTMLPropsoptional.

Dropdown Component

    <Dropdown
        name="dropdown"
        selfLabel="dropdown"
        isRequired
        onChange={(e) => {
          console.log(e);
        }}
        defaultValue={"--Select something from Dropdown--"}
        className={className}
      >
      {children}
    </Dropdown>
ParameterTypeDescription
isRequiredboolean //defaults to falseoptional.
isLoadingbooleanoptional.
defaultDisabledbooleanoptional.
selfLabelstringoptional.
optionalTextstringoptional.
textColorstringoptional.
defaultLabelstringoptional.
childrenReact.ReactNodeoptional.
invalidTextstringoptional.
defaultValuestring or number or readonly string[]optional.
selfLabelstringoptional.
...propsDetailedHTMLPropsoptional.

Form Container Component

    <FormContainer
        formTitle="title"
        previous={() => {}}
        submitClick={() => {}}
        submitLabel="submit"
        cancelLabel="cancel"
        isLoading={true || false}
      >
      {children}
    </FormContainer>
ParameterTypeDescription
formTitlestringrequired
isLoadingbooleanoptional.
previous(event?: React.BaseSyntheticEvent) => voidrequired
submitClick(event?: React.BaseSyntheticEvent) => voidrequired
childrenReact.ReactNoderequired
submitLabelstringrequired
cancelLabelstringrequired
backgroundColorstringrequired
...propsDetailedHTMLPropsrequired

File Upload Component

    <FileUpload
        name={name}
        File={file}
        isRequired={false} // default
        invalidText={invalidText}
        isSubmit={isSubmit}
        isSuccess={isSuccess}
        onChange={onChange}
    />
ParameterTypeDescription
FileFileoptional.
isSuccessbooleanoptional.
isSubmitbooleanoptional.
isRequiredboolean //defaults to falseoptional.
invalidTextstringoptional.

Inputfield Component

    <InputField
        type={type}
        placeholder={placeholder}
        isRequired //defaults to true
        selfLabel={selfLabel}
        className={className}
        onChange={onChange}
        name={name}
        value={value}
        invalidText={invalidText}
    />
ParameterTypeDescription
selfLabelstringoptional.
iconstringoptional.
iconclassNamestringoptional.
invalidTextstringoptional.
isRequiredboolean //defaults to falseoptional.
optionalTextstringoptional.
...propsReact.DetailedHTMLPropsoptional.

TextArea Component

    <InputField
        placeholder={placeholder}
        isRequired //defaults to true
        label={selfLabel}
        className={className}
        onChange={onChange}
        name={name}
        value={value}
        invalidText={invalidText}
    />
ParameterTypeDescription
selfLabelstringoptional.
iconstringoptional.
iconclassNamestringoptional.
invalidTextstringoptional.
isRequiredboolean //defaults to falseoptional.
optionalTextstringoptional.
...propsReact.DetailedHTMLPropsoptional.

Authors

License

MIT

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago