npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-good-ui

v0.8.5

Published

You can use react-native-good-ui in android, ios, web based on react-native.

Downloads

40

Readme

good-ui

good UI that supports react-native based android, ios and web

화면 기록 2024-03-02 오전 1 16 48

Requirement

# Enter commend in root directory at your react-native project
# If you want to use it in Web, refer to https://docs.expo.dev/versions/latest/sdk/reanimated/
yarn add react-native-reanimated

Installation

yarn add react-native-good-ui

Usage

import React, { useState } from 'react';
import { StyleSheet, ViewStyle } from 'react-native';
import {
  Button,
  Column,
  Divider,
  EdgeInsets,
  Input,
  Row,
  Select,
  Spacer,
  Text,
  ZIndex,
  storage,
} from 'react-native-good-ui';
import {
  useSharedValue,
  useAnimatedStyle,
  withSpring,
} from 'react-native-reanimated';

import type { AnimateStyle } from 'react-native-reanimated';

const storageKey = '@storage_test';

export default function App() {
  const [storageValue, setStorageValue] = useState('');

  React.useEffect(() => {
    const fetch = async () => {
      const aStorage = await storage.load(storageKey);

      if (aStorage) {
        setStorageValue(
          `Storage Value : ${aStorage}, but it will be removed  in the next run.`
        );
        await storage.remove(storageKey);
      } else {
        await storage.save(storageKey, 'hello world');
        setStorageValue(
          `Storage Value : null,  but It will be present in the next run.`
        );
      }
    };

    fetch().then();
  }, []);

  const offset = useSharedValue(0);

  const animatedStyles = useAnimatedStyle(() => {
    return {
      transform: [{ translateX: offset.value }],
    } as AnimateStyle<ViewStyle>;
  });

  const body = (
    <React.Fragment>
      <Text preset={'header3'}>Components</Text>

      <Spacer preset={'large'} />

      <Text preset={'header5'}>Divider</Text>

      <Divider />
      <Divider text={'message'} textEdgeInsets={'medium'} />

      <Column style={{ height: 200 }} alignItems={'center'}>
        <Divider
          direction={'vertical'}
          text={'Message'}
          textEdgeInsets={'small'}
        />
      </Column>
      <Divider direction={'vertical'} />

      <Spacer preset={'huge'} />

      <Text preset={'header5'}>Select</Text>
      <Select
        width={150}
        options={['Option 1', 'Option 2', 'Option 3']}
        style={{ zIndex: ZIndex.float + 1 }}
        onSelect={(option) => console.log(option)}
      />

      <Select
        options={['옵션 1', '옵션 2', '옵션 3']}
        onSelect={(option) => console.log(option)}
      />

      <Spacer preset={'huge'} />

      <Text preset={'header5'}>Button</Text>
      <Button text={'Button'} onPress={() => console.log('onPress')} />

      <Spacer preset={'huge'} />
      <Text preset={'header5'}>Input</Text>
      <Input placeholder={'입력'} />

      <Spacer preset={'huge'} />
      <Text preset={'header5'}>Storage</Text>
      <Text>{storageValue}</Text>

      <Spacer preset={'huge'} />

      <Text preset={'header5'}>Animated View</Text>
      <Spacer direction={'both'} preset={'medium'} />
      <Row
        animatable={true}
        elevation={24}
        round={'medium'}
        roundShape={'all'}
        style={[styles.box, animatedStyles]}
      />
      <Spacer preset={'large'} />
      <Button
        onPress={() => {
          offset.value = withSpring(Math.random() * 255);
        }}
        text={'Move'}
      />

      <Spacer preset={'large'} />

      <Text preset={'header5'}>Layout</Text>
      <Spacer preset={'medium'} />
      <Column
        style={styles.layout1}
        round={'medium'}
        edgeInsets={EdgeInsets.fromVH('medium', 'medium')}
      >
        <Column style={styles.layout2} round={'small'} />
      </Column>

      <Spacer preset={'large'} />

      <Text preset={'header5'}>Text</Text>
      <Text preset={'header1'}>header1</Text>
      <Text preset={'header2'}>header2</Text>
      <Text preset={'header3'}>header3</Text>
      <Text preset={'header4'}>header4</Text>
      <Text preset={'header5'}>header5</Text>
      <Text preset={'header6'}>header6</Text>
      <Text preset={'subtitle1'}>subtitle1</Text>
      <Text preset={'subtitle2'}>subtitle2</Text>
      <Text preset={'body1'}>body1</Text>
      <Text preset={'body2'}>body2</Text>
      <Text preset={'caption'}>caption</Text>
      <Text preset={'overline'}>overline</Text>
    </React.Fragment>
  );

  return (
    <Row>
      <Column style={styles.container} edgeInsets={EdgeInsets.right('medium')}>
        {body}
      </Column>
      <Column style={styles.container2}>{body}</Column>
    </Row>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexShrink: 1,
    alignItems: 'stretch',
    backgroundColor: 'white',
  },
  container2: {
    flex: 1,
    flexShrink: 1,
    alignItems: 'flex-start',
    backgroundColor: 'white',
  },
  box: {
    width: 100,
    height: 100,
    backgroundColor: '#6DB32A',
    justifyContent: 'center',
    alignItems: 'center',
  },
  layout1: {
    backgroundColor: 'red',
    width: 100,
    height: 100,
  },
  layout2: {
    backgroundColor: 'yellow',
    width: 50,
    height: 50,
  },
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library