1.0.145 • Published 13 hours ago

newron-ui v1.0.145

Weekly downloads
-
License
MIT
Repository
github
Last release
13 hours ago

Newron UI Library

This is the Newron UI Library, a collection of React components built with Tailwind CSS for creating beautiful and responsive user interfaces.

Installation

To use the Newron UI Library in your React projects, you can install it via npm:

npm install newron-ui --save

Import newron-ui css in App.js

import "newron-ui/dist/newron.css";

Locally Running the Library and Setup

Run This in Both App where you want use and also Newron-ui

npm link

Components

Here are the components available in the Newron UI Library:

TypeNameDescription
ComponentsButtonA customizable button component.
ComponentsCardA card-style component for displaying content.
ComponentsInputAn input field component.
ComponentsDropdownA dropdown component for selecting options.
ComponentsSelectA select component for selecting options.
ComponentsSearchBarA search bar component.
ComponentsResponsiveLayoutWrapperA responsive layout wrapper component.
ComponentsDatalistA datalist component.
ComponentsDatalist2Another datalist component.
ComponentsSearchableListA searchable list component.
ComponentsMultiSelectDatalistA multi-select datalist component.
ComponentsDynamicFormA dynamic form component.
ComponentsDataTableA data table component.
ComponentsLoaderA loader component.
ComponentsCheckboxA checkbox component.
ComponentsActionsCellA cell for action buttons in a table.
ComponentsNoPermissionA component for displaying a "No Permission" message.
ComponentsBreadcrumbA breadcrumb navigation component.
ComponentsAvatarAn avatar component.
ComponentsBadgeA badge component.
ComponentsSpinnerA spinner component.
ComponentsHoverableButtonA button with hover effects.
ComponentsAscDscShorterA component for sorting data.
ComponentsTableA table component.
ComponentsVerticalLineA vertical line component.
ComponentsHorizontalLineA horizontal line component.
ComponentsTableSkeletonA skeleton loader for tables.
ComponentsTablePaginationA pagination component for tables.
ComponentsSelectAllHeaderA header component for selecting all items in a table.
ComponentsTableHeaderSkeletonA skeleton loader for table headers.
ComponentsTableBodySkeletonA skeleton loader for table body.
ComponentsActionHeaderA header for action buttons in a table.
ComponentsUploadFileA file upload component.
ComponentsFormFieldA form field component.
ComponentsCombinedImageUploaderAn image uploader component.
ComponentsStepperA stepper component.
ComponentsCloseButtonA close button component.
ComponentsExcelGeneratorA component for generating Excel files.
ComponentsDownloadFileA component for downloading files.
ComponentsButtonElementA button element component.
ComponentsInputElementAn input element component.
ComponentsProfilesA component for displaying user profiles.
ComponentsProfileListModelA list model component for profiles.
HooksuseClickOutsideHandlerA hook for handling clicks outside a specified element.
HooksuseWindowWidthHeightA hook for tracking window width and height.
HooksuseScrollToLastElementA hook for scrolling to the last element in a container.
HooksuseColumnWidthsA hook for managing column widths.
HooksuseBodyOverflowA hook for controlling the overflow of the body.
HooksuseTimeoutA hook for managing timeouts.
HooksuseMediaQueryA hook for working with media queries.
HooksusePreviousA hook for accessing the previous value of a state.
HooksuseDocumentTitleA hook for setting the document title.
HooksuseKeyPressA hook for handling keyboard keypress events.
HooksuseOnlineStatusA hook for detecting online/offline status.
HooksuseScrollPositionA hook for tracking scroll position.
HooksuseGeolocationA hook for accessing geolocation information.
HooksuseLocalStorageWithExpiryA hook for managing local storage with expiry.
HooksuseClipboardA hook for working with the clipboard.
HooksuseIntervalA hook for managing intervals.
HooksuseHoverA hook for detecting hover status.
HooksuseDocumentVisibilityA hook for monitoring document visibility.
HooksuseDebounceA hook for debouncing function calls.
HooksuseMediaRecorderA hook for media recording capabilities.
HooksuseWebSocketA hook for WebSocket communication.
HooksuseModelPositionA hook for managing model position.
UtilitiesgetStatusColorClassA utility function for obtaining status color classes.

Usage

Import the components you need from the library in your React application and use them in your UI:

import React from "react";
import {
  Button,
  Card,
  Input,
  Dropdown,
  Select,
  SearchBar,
  ResponsiveLayoutWrapper,
  Datalist,
  DynamicForm,
} from "newron-ui";

const App = () => {
  return (
    <ResponsiveLayoutWrapper>
      {/* Use the components here */}
      <Card title="Sample Card" content="This is a sample card component." />
      <Button variant="primary" size="lg">
        Click Me
      </Button>
      <Input type="text" placeholder="Enter text..." />
      <Dropdown options={["Option 1", "Option 2", "Option 3"]} />
      <Select options={["Option 1", "Option 2", "Option 3"]} />
      <SearchBar onSearch={(searchText) => console.log(searchText)} />
      <Datalist
        options={["Option 1", "Option 2", "Option 3"]}
        onSelect={(option) => console.log(option)}
      />
      <DynamicForm
        initialValues={initialValues}
        validationSchema={validationSchema}
        fields={fields}
      />
    </ResponsiveLayoutWrapper>
  );
};

export default App;

Components

Here are the components available in the Newron UI Library:

ComponentPropsDescription
Buttonvariant: String, size: String, className: StringA customizable button component with various styles.
Cardtitle: String, content: StringA card component to display content with a title.
Inputlabel: String, field: Object, form: Object, rest: PropsAn input component to accept user input.
Dropdownoptions: Array of StringsA dropdown component to display a list of options.
Selectoptions: Array of StringsA select component to display a dropdown-style select element.
SearchBaronSearch: FunctionA search bar component to input search text and trigger search action.
ResponsiveLayoutWrapperNoneA wrapper component to create a responsive layout for your components.
Datalistoptions: Array of Strings, onSelect: FunctionA datalist component to search and select data.
DynamicForminitialValues: Object, validationSchema: Yup.Schema, fields: ArrayA dynamic form component to generate form fields dynamically.

Button

A customizable button component with various styles.

Props:

  • variant: The variant of the button. Available options are "primary" (default), "secondary", "success", and "danger".
  • size: The size of the button. Available options are "sm" (small), "md" (medium, default), "lg" (large), and "xl" (extra large).
  • className: Additional CSS class names to apply to the button.

Usage Example:

import React from "react";
import { Button } from "newron-ui-lib";

const MyComponent = () => {
  return (
    <Button variant="primary" size="lg">
      Click Me
    </Button>
  );
};

Card

A card component to display content with a title and content section.

Props:

  • title: The title of the card. (required)
  • content: The content of the card. (required)

Usage Example:

import React from "react";
import { Card } from "newron-ui-lib";

const MyComponent = () => {
  return (
    <Card title="Sample Card" content="This is a sample card component." />
  );
};

Input

An input component to accept user input.

Props:

  • label: The label for the input field.
  • field: The field object from Formik.
  • form: The form object from Formik.
  • variant: The variant of the input field. Available options are "outline" (default), "filled", and "underline".
  • size: The size of the input field. Available options are "small", "medium" (default), and "large".
  • responsive: Whether to apply responsive styles to the input field.

Usage Example:

import React from "react";
import { Input } from "newron-ui-lib";

const MyComponent = () => {
  return (
    <Input
      label="Username:"
      field={field}
      form={form}
      variant="outlined"
      size="small"
    />
  );
};

Dropdown

A dropdown component to display a list of options.

Props:

  • options: An array of options to be displayed in the dropdown. (required)

Usage Example:

import React from "react";
import { Dropdown } from "newron-ui-lib";

const MyComponent = () => {
  return <Dropdown options={["Option 1", "Option 2", "Option 3"]} />;
};

Select

A select component to display a dropdown-style select element.

Props:

  • options: An array of options to be displayed in the select. (required)

Usage Example:

import React from "react";
import { Select } from "newron-ui-lib";

const MyComponent = () => {
  return <Select options={["Option 1", "Option 2", "Option 3"]} />;
};

SearchBar

A search bar component to input search text and trigger search action.

Props:

  • onSearch: A function that will be called when the user performs a search. The search text is passed as an argument to this function. (required)

Usage Example:

import React from "react";
import { SearchBar } from "newron-ui-lib";

const MyComponent = () => {
  const handleSearch = (searchText) => {
    console.log("Searching for:", searchText);
    // Perform the search action here
  };

  return <SearchBar onSearch={handleSearch} />;
};

ResponsiveLayoutWrapper

A wrapper component to create a responsive layout for your components.

Usage Example:

import React from "react";
import { ResponsiveLayoutWrapper } from "newron-ui-lib";

const MyComponent = () => {
  return (
    <ResponsiveLayoutWrapper>
      {/* Your components go here */}
    </ResponsiveLayoutWrapper>
  );
};

Datalist

A datalist component to search and select data.

Props:

  • options: An array of options to be displayed in the datalist. (required)
  • onSelect: A function that will be called when the user selects an option. The selected option is passed as an argument to this function. (required)

Usage Example:

import React, { useState } from "react";
import { Datalist } from "newron-ui-lib";

const MyComponent = () => {
  const [selectedOption, setSelectedOption] = useState("");

  const handleSelect = (option) => {
    setSelectedOption(option);
  };

  return (
    <Datalist
      options={["Option 1", "Option 2", "Option 3"]}
      onSelect={handleSelect}
    />
  );
};

DynamicForm

A dynamic form component to generate form fields dynamically.

Props:

  • initialValues: An object containing the initial values for the form fields. (required)
  • validationSchema: A Yup schema for form validation. (required)
  • fields: An array of field objects to define the form fields. Each field object should have a type property that determines the type of the field (e.g., "text", "password", "dropdown", "datalist", "button", etc.), and other properties specific to each field type.

Usage Example:

import React from "react";
import { DynamicForm } from "newron-ui-lib";
import * as Yup from "yup";

const MyComponent = () => {
  const initialValues = {
    username: "",
    password: "",
  };

  const validationSchema = Yup.object({
    username: Yup.string().required("Username is required"),
    password: Yup.string().required("Password is required"),
  });

  const fields = [
    // Define your form fields here
  ];

  return (
    <DynamicForm
      initialValues={initialValues}
      validationSchema={validationSchema}
      fields={fields}
    />
  );
};

Contributing

We welcome contributions! If you find a bug or have a feature request, please open an issue or submit a pull request.

Contributors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

With these changes, the README.md file is updated to include the new Button component with the size option, as well as the DynamicForm component and the Datalist component in the components table.

1.0.145

13 hours ago

1.0.144

8 days ago

1.0.143

8 days ago

1.0.142

8 days ago

1.0.141

8 days ago

1.0.140

8 days ago

1.0.139

16 days ago

1.0.138

16 days ago

1.0.137

27 days ago

1.0.136

30 days ago

1.0.135

30 days ago

1.0.132

1 month ago

1.0.134

1 month ago

1.0.133

1 month ago

1.0.131

1 month ago

1.0.130

1 month ago

1.0.128

1 month ago

1.0.127

1 month ago

1.0.126

1 month ago

1.0.107

2 months ago

1.0.106

2 months ago

1.0.109

2 months ago

1.0.108

2 months ago

1.0.121

2 months ago

1.0.120

2 months ago

1.0.123

2 months ago

1.0.122

2 months ago

1.0.125

2 months ago

1.0.124

2 months ago

1.0.110

2 months ago

1.0.112

2 months ago

1.0.111

2 months ago

1.0.118

2 months ago

1.0.117

2 months ago

1.0.119

2 months ago

1.0.114

2 months ago

1.0.113

2 months ago

1.0.116

2 months ago

1.0.115

2 months ago

1.0.101

2 months ago

1.0.100

2 months ago

1.0.103

2 months ago

1.0.102

2 months ago

1.0.105

2 months ago

1.0.104

2 months ago

1.0.99

2 months ago

1.0.98

2 months ago

1.0.97

2 months ago

1.0.96

2 months ago

1.0.93

3 months ago

1.0.92

3 months ago

1.0.91

3 months ago

1.0.89

3 months ago

1.0.88

3 months ago

1.0.86

3 months ago

1.0.84

4 months ago

1.0.83

4 months ago

1.0.82

4 months ago

1.0.80

4 months ago

1.0.78

4 months ago

1.0.77

4 months ago

1.0.76

4 months ago

1.0.73

4 months ago

1.0.72

4 months ago

1.0.75

4 months ago

1.0.74

4 months ago

1.0.71

5 months ago

1.0.70

5 months ago

1.0.62

6 months ago

1.0.61

6 months ago

1.0.60

6 months ago

1.0.66

5 months ago

1.0.65

5 months ago

1.0.64

6 months ago

1.0.63

6 months ago

1.0.68

5 months ago

1.0.67

5 months ago

1.0.44

8 months ago

1.0.48

7 months ago

1.0.47

7 months ago

1.0.46

7 months ago

1.0.45

7 months ago

1.0.51

6 months ago

1.0.50

6 months ago

1.0.55

6 months ago

1.0.54

6 months ago

1.0.52

6 months ago

1.0.59

6 months ago

1.0.57

6 months ago

1.0.56

6 months ago

1.0.39

8 months ago

1.0.40

8 months ago

1.0.43

8 months ago

1.0.42

8 months ago

1.0.41

8 months ago

1.0.38

8 months ago

1.0.37

8 months ago

1.0.35

8 months ago

1.0.34

8 months ago

1.0.32

8 months ago

1.0.31

9 months ago

1.0.30

9 months ago

1.0.29

9 months ago

1.0.28

9 months ago

1.0.27

9 months ago

1.0.26

9 months ago

1.0.25

9 months ago

1.0.24

9 months ago

1.0.23

9 months ago

1.0.22

9 months ago

1.0.21

9 months ago

1.0.9

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago