1.0.16 • Published 12 months ago

asayyex-ui v1.0.16

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

Asayyex UI


This library contains components require to build a beautiful React App faster and better. We are planning to include components that are not available in the current UI Libraries.

Installation

npm:

npm install asayyex-ui

yarn:

yarn add asayyex-ui

Getting started with Asayyex UI

Here is an example of a basic app using Asayyex UI's Button component:

import React from 'react';
import { Button } from 'asayyex-ui';

function App() {
  return <Button variant="contained">Hello World</Button>;
}

Try changing the variant to outlined.


Components Available

All the available components are listed down here. If you don't see any component you want. Don't worry we are working on it.

  1. Accordion
  2. Button
  3. Checkbox
  4. Chip
  5. DatePicker
  6. Drawer
  7. drawer
  8. Select
  9. Spinner
  10. Switch
  11. TextField
  12. TimePicker

Accordion

Here is an example of Accordion

import React from 'react';
import { Accordion } from 'asayyex-ui';

function App() {
  return <Accordion title="Accordion Header">
  Accordion body
  </Accordion>;
}

Available Props

PropTypeDescriptionDefault
titlestringThe title of the accordion component.null
isDisabledboolIndicates whether the accordion is disabled or not.false
isOpenboolIndicates whether the accordion is open or not. Used to control the accordion manually.null
onChangefuncIt is used when you want to control the accordion from external state.undefined

Button

Here is an example of Button

import React from 'react';
import { Button } from 'asayyex-ui';

function App() {
  return <Button variant="contained">
  Contained Button
  </Button>;
}

Available Props

PropTypeDescriptionDefault
variant'contained' \| 'outlined' \| 'link' \| 'danger' \| 'success' \| 'warning'To enable the clicking ripple effect.contained
rippleboolTo enable the clicking ripple effect.false
isDisabledboolIndicates whether the button is disabled or not.false
size'sm' \| 'md' \| 'lg'Indicates the size of the button.md
isLoadingboolIndicates whether the button is in the loading state or not.false

Checkbox

Here is an example of Checkbox:

import React from 'react';
import { Checkbox } from 'asayyex-ui';

function App() {
  const handleCheckChange = (event) => {
    console.log('Checkbox checked:', event.target.checked);
  };

  return (
    <div>
      <Checkbox
        label="Checkbox Label"
        size="md"
        onCheckChange={handleCheckChange}
        defaultChecked={false}
        isDisabled={false}
        isChecked={false}
        error={false}
        name="checkboxInput"
      />
    </div>
  );
}

Available Props

PropTypeDescriptionDefault
labelstringThe label text associated with the checkbox-
size'sm' | 'md' | 'lg'Specifies the size of the checkboxundefined
onCheckChange(event: React.ChangeEvent) => voidCallback function triggered when the checkbox value changes-
defaultCheckedbooleanSpecifies whether the checkbox is checked by defaultfalse
isDisabledbooleanIndicates whether the checkbox is disabledfalse
isCheckedbooleanSpecifies whether the checkbox is checkedfalse
errorbooleanIndicates whether there is an error with the checkboxfalse
namestringThe name attribute of the checkbox-

Chip

Here is an example of Chip:

import React from 'react';
import { Chip } from 'asayyex-ui';

function App() {
  const handleDelete = (event) => {
    console.log('Chip deleted:', event);
  };

  return (
    <Chip
      size="md"
      variant="contained"
      onDelete={handleDelete}
      deleteIcon={<DeleteIcon />}
      avatar={<Avatar src={avatarImage} alt="Avatar" />}
      title="Example Chip"
      isClickable={true}
    />
  );
}

Available Props

PropTypeDescription
size'sm' | 'md' | 'lg'Specifies the size of the chip
variant'contained' | 'outlined'Specifies the variant of the chip
onDelete(event: React.MouseEvent) => void | undefinedCallback function triggered when the delete icon is clicked
deleteIconReact.ReactNodeCustom delete icon to be displayed
avatarReact.ReactNodeAvatar element to be displayed on the left side of the chip
titlestringThe title text to be displayed inside the chip
isClickablebooleanIndicates whether the chip is clickable

DatePicker

Here is an example of DatePicker

import React from 'react';
import { DatePicker } from 'asayyex-ui';

function App() {
  const handleDateChange = (date) => {
    console.log('Selected date:', date);
  };

  return (
    <div>
      <DatePicker
        label="Select Date"
        placeholder="Choose a date"
        value={new Date()}
        onDateChange={handleDateChange}
        dateFormat="DD/MM/YYYY"
        wrapperClassName="datepicker-wrapper"
        labelClassName="datepicker-label"
        inputClassName="datepicker-input"
        iconClassName="datepicker-icon"
        errorClassName="datepicker-error"
        wrapperStyle={{ marginBottom: '10px' }}
        labelStyle={{ color: 'blue' }}
        inputStyle={{ border: '1px solid black' }}
        iconStyle={{ fontSize: '20px' }}
        errorStyle={{ color: 'red' }}
        minDate={new Date(2023, 0, 1)}
        maxDate={new Date(2023, 11, 31)}
      />
    </div>
  );
}

export default App;

Available Props

PropTypeDescriptionDefault
size'sm' | 'md' | 'lg' | undefinedSpecifies the size of the date picker inputundefined
isDisabledbooleanIndicates whether the date picker input is disabledfalse
errorbooleanIndicates whether there is an error with the date picker inputfalse
valueDate | string | undefinedThe value of the date picker inputundefined
onDateChange(date: Date) => voidCallback function triggered when the date value changes-
placeholderstringThe placeholder text for the date picker input-
dateFormat'DD/MM/YYYY' | 'MM/DD/YYYY' | 'YYYY/MM/DD' | 'DD-MM-YYYY' | 'MM-DD-YYYY' | 'YYYY-MM-DD' | 'DD MMM YYYY' | 'YYYY MMM DD' | 'MMM DD, YYYY'The format of the displayed date value'DD/MM/YYYY'
namestringThe name attribute of the date picker input-
labelstringThe label text associated with the date picker input-
errorMsgstringThe error message to display when there is an error with the date picker input-
descriptionstringThe description text for the date picker input-
wrapperClassNamestringAdditional class name for the wrapper element-
labelClassNamestringAdditional class name for the label element-
inputClassNamestringAdditional class name for the input element-
iconClassNamestringAdditional class name for the icon element-
errorClassNamestringAdditional class name for the error element-
wrapperStyleReact.CSSPropertiesAdditional inline styles for the wrapper element-
labelStyleReact.CSSPropertiesAdditional inline styles for the label element-
inputStyleReact.CSSPropertiesAdditional inline styles for the input element-
iconStyleReact.CSSPropertiesAdditional inline styles for the icon element-
errorStyleReact.CSSPropertiesAdditional inline styles for the error element-
minDateDateThe minimum selectable date in the date picker-
maxDateDateThe maximum selectable date in the date picker--

Drawer

Here is an example of Drawer:

import React, { useState } from 'react';
import { Drawer } from 'asayyex-ui';

function App() {
  const [open, setOpen] = useState(false);

  const handleClose = () => {
    setOpen(false);
  };

  return (
    <div>
      <button onClick={() => setOpen(true)}>Open Drawer</button>
      <Drawer
        open={open}
        onClose={handleClose}
        size="md"
        position="right"
        title="Drawer Title"
        closeOnOverlayClick={true}
      >
        <p>Drawer Content</p>
        <button onClick={handleClose}>Close Drawer</button>
      </Drawer>
    </div>
  );
}

Available Props

PropTypeDescription
openbooleanIndicates whether the drawer is open or closed.
onClose() => voidCallback function to be executed when the drawer is closed.
childrenReact.ReactNodeContent to be displayed within the drawer.
closeOnOverlayClickbooleanIndicates whether the drawer should be closed when clicking outside the drawer.
size'sm' | 'md' | 'lg'Specifies the size of the drawer.
position'top' | 'bottom' | 'right' | 'left'Specifies the position of the drawer.
titlestring | React.ReactNodeTitle text or custom element to be displayed in the drawer header.
footerReact.ReactNodeContent to be displayed in the drawer footer.

TextField

Here is an example of TextField

import React from 'react';
import { TextField } from 'asayyex-ui';

function App() {
  return (
      <TextField
        label="Name"
        placeholder="Enter your name"
        size="md"
        isDisabled={false}
        error={false}
        leftIcon={<i className="fa fa-user" />}
        rightIcon={<i className="fa fa-check" />}
        wrapperClassName="text-field-wrapper"
        labelClassName="label"
        inputClassName="input"
        iconClassName="icon"
        errorClassName="error"
        wrapperStyle={{ marginBottom: '10px' }}
        labelStyle={{ color: 'blue' }}
        inputStyle={{ border: '1px solid black' }}
        iconStyle={{ fontSize: '20px' }}
        errorStyle={{ color: 'red' }}
      />
  );
}

export default App;

Available Props

PropTypeDescriptionDefault
size'sm' | 'md' | 'lg' | undefinedSpecifies the size of the input fieldundefined
isDisabledbooleanIndicates whether the input field is disabledfalse
leftIconReact.ReactNodeThe icon to be displayed on the left sideundefined
rightIconReact.ReactNodeThe icon to be displayed on the right sideundefined
errorbooleanIndicates whether there is an error with the inputfalse
labelstringThe label text associated with the input fieldundefined
wrapperClassNamestringAdditional class name for the wrapper elementundefined
labelClassNamestringAdditional class name for the label elementundefined
inputClassNamestringAdditional class name for the input elementundefined
iconClassNamestringAdditional class name for the icon elementsundefined
errorClassNamestringAdditional class name for the error elementundefined
wrapperStyleReact.CSSPropertiesAdditional inline styles for the wrapper elementundefined
labelStyleReact.CSSPropertiesAdditional inline styles for the label elementundefined
inputStyleReact.CSSPropertiesAdditional inline styles for the input elementundefined
iconStyleReact.CSSPropertiesAdditional inline styles for the icon elementsundefined
errorStyleReact.CSSPropertiesAdditional inline styles for the error elementundefined

TimePicker

Here is an example of TimePicker

import React from 'react';
import { TimePicker } from 'asayyex-ui';

function App() {
  const handleTimeChange = (time) => {
    console.log('Selected time:', time);
  };

  return (
    <div>
      <TimePicker
        label="Select Time"
        placeholder="Choose a time"
        value="12:00 PM"
        onTimeChange={handleTimeChange}
        timeFormat="hh:mm A"
        name="timeInput"
        is24Hours={false}
        wrapperClassName="timepicker-wrapper"
        labelClassName="timepicker-label"
        inputClassName="timepicker-input"
        iconClassName="timepicker-icon"
        errorClassName="timepicker-error"
        wrapperStyle={{ marginBottom: '10px' }}
        labelStyle={{ color: 'blue' }}
        inputStyle={{ border: '1px solid black' }}
        iconStyle={{ fontSize: '20px' }}
        errorStyle={{ color: 'red' }}
      />
    </div>
  );
}

export default App;

Available Props

PropTypeDescriptionDefault
size'sm' | 'md' | 'lg' | undefinedSpecifies the size of the time picker inputundefined
isDisabledbooleanIndicates whether the time picker input is disabledfalse
errorbooleanIndicates whether there is an error with the time picker inputfalse
valuestring | undefinedThe value of the time picker inputundefined
onTimeChange(time: string | undefined) => voidCallback function triggered when the time value changes-
placeholderstringThe placeholder text for the time picker input-
timeFormat'hh:mm A' | 'HH:mm' | 'HH:mm A' | 'hh:mm' | 'hh:mm:ss A' | 'hh:mm:ss' | 'HH:mm:ss A' | 'HH:mm:ss'The format of the displayed time value'hh:mm A'
namestringThe name attribute of the time picker input-
is24HoursbooleanIndicates whether to use the 24-hour format instead of the AM/PM formatfalse
labelstringThe label text associated with the time picker input-
errorMsgstringThe error message to display when there is an error with the time picker input-
descriptionstringThe description text for the time picker input-
wrapperClassNamestringAdditional class name for the wrapper element-
labelClassNamestringAdditional class name for the label element-
inputClassNamestringAdditional class name for the input element-
iconClassNamestringAdditional class name for the icon element-
errorClassNamestringAdditional class name for the error element-
wrapperStyleReact.CSSPropertiesAdditional inline styles for the wrapper element-
labelStyleReact.CSSPropertiesAdditional inline styles for the label element-
inputStyleReact.CSSPropertiesAdditional inline styles for the input element-
iconStyleReact.CSSPropertiesAdditional inline styles for the icon element-
errorStyleReact.CSSPropertiesAdditional inline styles for the error element-

1.0.16

12 months ago

1.0.15

12 months ago

1.0.14

12 months ago

1.0.13

12 months ago

1.0.12

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago