1.2.0 • Published 4 years ago

@alanngo/custom-components v1.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Custom Components

🚀 Install

npm i @alanngo/custom-components

or

yarn add @alanngo/custom-components

🚀 Import Components

import {RenderIf} from "@alanngo/custom-components/dist"

🚀 Components

AwesomeText

An easy text component to create individual styled text and apply custom fonts without affecting other elements

Avoid

<h1 style= {{color: "red"}}> red h1 </h1>
<i><p>blue italic paragraph</p></i>

Prefered

<AwesomeText as="h1" color="red">red h1</AwesomeText>

<AwesomeText as="p" color="blue" italic>blue italic paragraph</AwesomeText>

Break

Need multiple line breaks without rewriting <br/> tag? Use this component to help you in just 1 line

Avoid

<br/>
<br/>
<br/>
...

Prefered

<Break number={3}/> 

RenderIf

Eliminates the need of ternary operator for conditional rendering

Avoid

const arr = [1, 2, 3]

{(arr.length>0?
<h1> everything nested will render if arr length is greater than 0 </h1>:
<></>)}

Prefered

const arr = [1, 2, 3]

<RenderIf condition = {arr.length > 0}>
<h1> everything nested will render if arr length is greater than 0 </h1>
</RenderIf>

🚀 Hooks

coming soon

1.2.0

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago