0.1.5 • Published 1 year ago

@melmahdi/reactuc v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Utility Components

Reusable react components to maximize your coding efficiency.

Install

npm i @melmahdi/reactuc

Components

  • If
  • Image
  • Iterate
  • Table

Usage

If

Conditional rendering component

import { If } from "@melmahdi/reactuc";

<If condition={condition: 1 | 0} otherwise={otherwise: ReactNode}>
  ...
</If>

Image

Component to handle broken images

import { Image } from "@melmahdi/reactuc";

<Image fallback={...} src="..." alt="..." />

Iterate

Component to handle iterations.

Display list of paragraph (with html tag):

import { Iterate } from '@melmahdi/reactuc';

<Iterate data={['...', '...', '...']} element="p" />;

Display list of objects (with component):

import { Iterate } from "@melmahdi/reactuc";

const cards = [
  { id: '75ebc192', title: 'Lira Fresh Optimization' },
  ...
];

<Iterate data={users} element={UserComponent} />;

Table

Table component

import { Table } from "@melmahdi/reactuc";

const tableData = {
  head: ['First', <button type="button">Action</button>],
  body: [
    ['One', 'Two'],
    ...,
  ]
};

<Table {...data} />
0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago