• This repository has been archived on 11/Nov/2020
  • Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Neumorphism UI library for react-native

This package is deprecated, please use other package.

react-native-neomorph-shadows

react-native-neu-element ยท Github license npm version Downloads

A React Native Component Library built on top of the concept of neumorphism.(Work for Android and Ios) React-native-neu-element ( RNNE ) is a JavaScript library for building neumorphic ui on react-native.

  • Easy To Use: RNNE makes it easier to create neumorphic ui without so much pain.

  • Generic Component RNNE makes it easier to create your own neumorphic component by implementing custom styling.

  • Auto Calculate RNNE will automatically calculate the shadows for light and dark base on your theme color, of course you need to pass in color as props.

react-native-neu-element demo

Installation

With react-native-cli

Install library from npm

npm install --save react-native-neu-element

npm install --save react-native-svg

npm install --save react-native-reanimated

npm install --save react-native-linear-gradient

npm install --save react-native-neu-element react-native-svg react-native-reanimated react-native-linear-gradient

I am finding a way to install all dependencies by just installing RNNE, sorry about that.

Notice

If you are a professional svg player, please help create the real inset shadow. You are welcome to leave comments if you found any bugs or thing to have.

Props

Every Neumorphic Component in react-native-neu-element has the following props: ( *must have )

  1. Color: String*
  2. Height: Number*
  3. Width: Number*

Examples

1. NeuView

Basic react-native-neu-element Element, Same as View in react-native.

NeuView

import { NeuView } from 'react-native-neu-element';
...
    return (
        // Normal
        <NeuView color='#eef2f9' height={100} width={100} borderRadius={16}>
          // Your Code
        </NeuView>

        // Inset
         <NeuView color='#eef2f9' height={100} width={100} borderRadius={16}
          inset
        >
          // Your Code
        </NeuView>

        // Convex
         <NeuView color='#eef2f9' height={100} width={100} borderRadius={16}
          convex
         >
          // Your Code
        </NeuView>

        // Concave
         <NeuView color='#eef2f9' height={100} width={100} borderRadius={16}
           concave
         >
          // Your Code
        </NeuView>

    );
...

Don't like every element in the child of NeuView to be centered? Use containerStyle props to re-style your component! ...Or wrap your children with a View and nest it inside NeuView.

import { NeuView } from 'react-native-neu-element'
...
    return (
      <NeuView
        width={100}
        height={100}
        color={'#eef2f9'}

        containerStyle={{
          //Any style
          flexDirection: 'row'
        }}
      >
        //Your Code
      </NeuView>
    )
...
2. NeuInput

NeuInput

Simple Neumorphic Text Input

import { NeuInput } from 'react-native-neu-element';
...
    return (
      <>
        <NeuInput onChangeText={setText} value={text} placeholder='Text Input...'/>
      </>
    );
...

You can also add prefix into text input like this:

NeuInput with Prefix

import { NeuInput } from 'react-native-neu-element';
import { Image } from 'react-native';
...
    return (
      <>
        <NeuInput
          prefix={
            <Image source={require('path/to/image.png')}
              style={{width: 25, height: 25}}
            />
          }
          onChangeText={setText} value={text} placeholder='Search...'
        />
      </>
    );
...
  1. NeuButton

Very similar to what NeuView does, well they are the same, instead, this time it is touchable!

You can pass in onPress / onPressIn / onPressOut to execute different action in a single press action.

NeuButton

import { NeuButton } from 'react-native-neu-element'
...
    return (
        //Normal Button
        <NeuButton
            color="#eef2f9"
            width={100}
            height={100}
            borderRadius={16}
            style={{marginRight: 30}}>
            <Text>Normal Btn</Text>
          </NeuButton>

          //Convex Button
          <NeuButton
            color="#eef2f9"
            width={100}
            height={100}
            borderRadius={16}

            isConvex

            style={{marginRight: 30}}>
            <Text>Convex Btn</Text>
          </NeuButton>

          //Make it always active
          <NeuButton
            color="#eef2f9"
            width={100}
            height={100}
            borderRadius={16}

            active

            style={{marginRight: 30}}>
            <Text>Active Btn</Text>
          </NeuButton>
    );
...
  1. NeuSwitch

Waiting for toggling button? Here it is !

Imgur

as it is a switch button, isPressed and setIsPressed is needed for state.

import {NeuSwitch} from 'react-native-neu-element';
...
    return (
        <NeuSwitch
          isPressed={isPressed}
          setIsPressed={setIsPressed}
          color="#eef2f9"
          containerHeight={40}
          containerWidth={80}
          buttonHeight={40}
          buttonWidth={45}
        />

        //button with custom gradient
        <NeuSwitch
          isPressed={isPressed}
          setIsPressed={setIsPressed}
          color="#eef2f9"
          containerHeight={40}
          containerWidth={80}
          buttonHeight={40}
          buttonWidth={45}

          customGradient={['#fc6859', '#e945d0']}
        />
    );
...
  1. NeuSpinner

Most of the apps have remote data, that is why we need a cute spinner.

NeuSpinner this preview seems laggy, but the result in the application is much smoother as normal.

import { NeuSpinner } from 'react-native-neu-element;
...
    return (
      <NeuSpinner
        //Required
        color='#eef2f9'
        size={50}
        indicatorColor='#aaffc3' // Mint

        //Optional
        //Determine how fast do a spinner spin one cycle
        //Default: 1000
        duration={1000}

        //Optional
        //Easing Type
        //Accept Easing from react-native-reanimated
        //Default: Easing.linear
        easingType={Easing.linear}
      />
    )
...
  1. NeuBorderView

NeuView With a nice looking border.

NeuBorderView

import { NeuBorderView } from 'react-native-neu-element'
...
    return (
      <NeuBorderView
        //Required
        width={200}
        height={100}
        color={'#eef2f9'}

        //Optional
        //Specify the width of the border
        //Default: 10
        borderWidth={10}

        //Optional
        //Specify the radius of the border
        //Default: 0
        borderRadius={16}
      >
      </NeuBorderView>
    )
...

More Repositories

1

nest-api-generator

A Nest JS API Generation tool, aiming to provide the complete API information for front-end developer.
TypeScript
6
star
2

jamyth-script-v2

React Cli tool for boilerplate generation, with webpack, react, scss, typescript
TypeScript
5
star
3

expo-go-game

A Go Game built with expo
TypeScript
3
star
4

api-code-generator

An API Code Generator for generating files with the result created by nest-api-generator
TypeScript
2
star
5

react-cloud-state

A minimal state management in between redux and context api, for React
TypeScript
2
star
6

version-checker

A Tool for Validating versions between package.json and node_modules
TypeScript
2
star
7

Jamyth

Welcome !
TypeScript
2
star
8

jamyth-script

React Starter CLI
JavaScript
2
star
9

next-recoil

A NextJS Boilerplate for using designated project structure and Opt-in Recoil
TypeScript
2
star
10

jconfig

A config repo for prettier and eslint config
TypeScript
2
star
11

use-translation

A React Hook for Language Translation
TypeScript
2
star
12

coil-react

A React Framework combined react-router, recoil, react
TypeScript
2
star
13

core-codegen

A simple codegen tool
TypeScript
2
star
14

EatWhatGood

A web-app that will help you choose your meal !
TypeScript
1
star
15

time-killer-game

TypeScript
1
star
16

hk-mtr-util

A TypeScript Library contains HKMTR information, All Station, All Line, Traditional Chinese translation
TypeScript
1
star
17

foul-language-counter

a simple penalty counter
TypeScript
1
star
18

PUBG-record-tracker

Simple react native application integrates with PUBG API
JavaScript
1
star
19

instructions

A List of md files for instructions
1
star
20

react-dnr-container

A React component that allows resize & reposition
TypeScript
1
star
21

flappy-bird

TypeScript
1
star
22

webpack-runner

A Complete Clone of @pinnacle0/webpack-util , with slight different
TypeScript
1
star
23

libs

TypeScript
1
star
24

metamatter

A Type Generation Library for building exportable backend type definition, easily to adopt in different TypeScript-based backend development
TypeScript
1
star
25

remob

TypeScript
1
star
26

Jalendar

A Calendar PWA
TypeScript
1
star
27

JFolderize

A VSCode extension that turns your MyAwesomeFile.ts into MyAwesomeFile/index.ts
TypeScript
1
star
28

shorten-url

A simple shorten url service that will cache your link for 7 days
TypeScript
1
star