1.0.30 • Published 8 months ago

@viktorvojtek/react-native-simple-components v1.0.30

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

@viktorvojtek/react-native-simple-components

This package contains a collection of a few essential, customizable and reusable UI components built with React on top of React Native components. These components are designed to be easy to use, highly flexible and allowing you to quickly and easily build beautiful user interfaces for your projects.

This package inherits react native components such as buttons, spinner, text, scrollview, and more. Each component is just a react native component with enhanced list of style props, to directly style a component via props.

This approach leads to increased development speed when building UI without compromising app performance at all. That being said we are building pure React Native components (best for performance), that can be styled as quickest as possible via props only.

As mentioned above, this package is really simple and easy to use. It's a great choice for beginners and experienced developers alike, when you need to build a UI quickly and easily, right out of the box. There is no configuration to be set up, no boilerplate code to write. And it comes with TypeScript support out of the box with all the types and beauty of intellisense.

I hope you find this components package useful in your projects. If you have any questions or feedback, please don't hesitate to reach out to me. Thank you for using this package!

Installation

Make sure you have installed React Native of version 0.60 or higher.

NPM:

$ npm -i @viktorvojtek/react-native-simple-components

Yarn:

$ yarn add @viktorvojtek/react-native-simple-components

Documentation

Usage Example

import { Button, Stack, Text } from '@viktorvojtek/react-native-simple-components';

const App = () => {
  return (
    <Stack
      flexDirection="column"
      backgroundColor="red"
      borderWidth={1}
      borderColor="blue"
    >
      <Button
        onPress={() => console.log('Button pressed')}
        backgroundColor="green"
        borderRadius={10}
        padding={10}
      >
        <Text color="white">Button</Text>
      </Button>
    </Stack>
  );
};

Components

ComponentPropsDescriptionDefaults
Button Pressable props , View Style props A basic button component
Center View Style props A component that centers it's children components both horizontally and vertically
Circlesize: Number | undefined, View Style props A component that renders a circlesize: 40bgColor: '#d3d3d3'
Checkboxchildren: ReactNode | undefined, isChecked: boolean | undefined, onChange: (isChecked: boolean) => void | undefined, View Style props A checkbox component
Dividercolor: Color | String, isVertical: boolean | undefined, View Style props A component that renders a divider linecolor: '#d3d3d3'isVertical: false
Image Image props , View Style props Replacement for Image component
Pressable Pressable props , View Style props Replacement for Pressable component
Spinner ActivityIndicator props , View Style props Displays a circular loading indicator
Stack View Style props Replacement for View component
StackX View Style props A Stack component rendering it's children components horizontally by default
StackY View Style props A Stack component rendering it's children components vertically by default
Text Text props , Text Style props Replacement for Text component
TextInput TextInput props , TextInput Style props Replacement for TextInput component

Shorthand Props

Prop NameDescriptionTypeDefault
bgColorBackground colorColor | String | undefined'#d3d3d3'
mMarginNumber | String | undefined0
mtMargin topNumber | String | undefined0
mrMargin rightNumber | String | undefined0
mbMargin bottomNumber | String | undefined0
mlMargin leftNumber | String | undefined0
mxMargin horizontalNumber | String | undefined0
myMargin verticalNumber | String | undefined0
pPaddingNumber | String | undefined0
ptPadding topNumber | String | undefined0
prPadding rightNumber | String | undefined0
pbPadding bottomNumber | String | undefined0
plPadding leftNumber | String | undefined0
pxPadding horizontalNumber | String | undefined0
pyPadding verticalNumber | String | undefined0

Note: All shorthand props can be used with all components such as: Button, Center, Circle, Divider, Image, Pressable, Spinner, Stack, StackX, StackY, Text, TextInput

Note: style prop still works as all othern React Native props and APIS for related components

1.0.29

8 months ago

1.0.30

8 months ago

1.0.19

12 months ago

1.0.18

12 months ago

1.0.17

12 months ago

1.0.22

12 months ago

1.0.21

12 months ago

1.0.20

12 months ago

1.0.26

12 months ago

1.0.25

12 months ago

1.0.24

12 months ago

1.0.23

12 months ago

1.0.28

12 months ago

1.0.27

12 months ago

1.0.16

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago