1.12.14 • Published 4 months ago

@team-devmonster/react-tags v1.12.14

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

@team-devmonster/react-tags

:warning: It's under development

This is under devmonster's react & react-native union project.

This project is part of the react-module & react-native-module projects, that integrate react & react-native by the devmonster team. react-native => @team-devmonster/react-native-tags General react-modules load map => here; General react-native-modules load map => here;

Other react modules

author: devmonster

We are always looking for investment or assistance. hompage: https://devmonster.co.kr email: aldegad@devmonster.co.kr

items

  • o => Just br.
  • o(#Button)
  • o
  • o(#Img)
  • o => this is for main contents. extends div.
  • o => this is for text. extends div.
  • o => this is for text. extends div.
  • o => this is for inline text. extends div.
  • o => this is for define list. extends div.
  • o => this is for define list title. extends div.
  • o => this is for define list description. extends div.
  • o => Under development

additional Items

These items are not contained this library. I super recommend use with this plz. from react-form.

new Items

These Used to explicitly declare a tag. It has the same name and usage as the components used in react-native.

Getting started

$ npm install @team-devmonster/react-tags@latest

Examples

Easy. Too Easy.

step1. Set Provider

// App.theme.tsx => You can use any file name :)
import { TagProvider, TagStyle, ButtonProps } from '@team-devmonster/react-tags';

export const AppTagProvider = ({children}: {children:React.ReactNode}) => {

  // useTheme is in react-theme. If you wanna use darkmode easily, use it.
  //const { div, button } = useTheme<Theme>();

  const div:TagStyle = {
    color: color.black,
    fontSize: fontSize.base
  }
  const button:ButtonProps = {
    color: color.white,
    style: {
      cursor: 'pointer',
      position: 'relative',
      padding: 10,
      alignItems: 'center',
      justifyContent: 'center',
      fontSize: fontSize.base,
      minHeight: 42,
      borderRadius: 5
    },
    disabledStyle: {
      opacity: 0.5
    }
  }
  const input:InputConfig = {
    style: {
      backgroundColor: color.white,
      borderColor: color.step300,
      color: color.black,
      placeholderColor: color.step500,
      borderRadius: 5,
      borderWidth: 1,
      fontSize: fontSize.base,
      paddingTop: 10,
      paddingBottom: 10,
      paddingLeft: 10,
      paddingRight: 10,
      minHeight: 42,
      marginTop: 8,
      marginBottom: 8
    },
    errorStyle: {
      borderColor: color.warning,
      marginBottom: 0 // for errorText
    },
    disabledStyle: {
      backgroundColor: color.step100,
      borderColor: color.step200
    }
  }

  const errorText:ErrorTextConfig = {
    style: {
      color: color.danger,
      marginBottom: 8
    }
  }
  return (
    <TagProvider tagConfig={{ div, button, input, errorText }}>
      {children}
    </TagProvider>
  )
}
import { AppTagProvider } from './App.theme';

export default function App() {

  return (
    <AppTagProvider>
      <Component></Component>
    </AppTagProvider>
  )
}

step2. Use

import React from "react";
import { useTheme } from '@team-devmonster/react-theme';
import { Theme } from './App.theme';
import { Div, Button, Img, P, Span, Br } from "@team-devmonster/react-tags";

const TagsEx = () => {

  // useTheme is in react-theme. If you wanna use darkmode easily, use it.
  const { color, fontSize } = useTheme<Theme>();

  return (
    <Div
      onLayout={(e) => {
        console.log(e.nativeEvent.layout);
      }}
      style={{
        backgroundColor: color.backgroundColor, 
        flex: 1, 
        padding: 18 
      }}>
      <Div style={{ fontSize: fontSize.xl }}>
        {`1. div => <Div></Div>`}
      </Div>
      <Div>
        <Button color={color.primary} onClick={() => alert('pressed')}>
          {`2. button => <Button></Button>`}
        </Button>
      </Div>
      <Div>
        <Img
          style={{
            width: '100%',
            aspectRatio: 1.774, 
            backgroundColor: color.step500
          }} 
          src="https://devmonster.co.kr/static/media/main-bg-05.d88f30e7.png"></Img>
      </Div>
      <P style={{
        marginBottom: 24, 
        height: 80
        }}>
        hello P
        <Span style={{ color: color.danger }}>hello Span</Span>
        <Button 
          color={color.primary} 
          style={{ display: 'inline-flex', height: 40 }}>inline button</Button>
        hello~!
      </P>
      <P style={{ marginBottom: 20, color: color.primary }}>
        hello?
        <Button color={color.step500}>not inline button. normal button.</Button>
      </P>
      <P>
        text with <Br/>hello
      </P>
      <Button 
        color={color.primary}
        fill="outline"
        style={{ 
          alignSelf: 'stretch', 
          alignItems: 'center',
          fontSize: fontSize.sm,
          ...shadow.base,
          marginBottom: 18
        }}>
          hellohellohello omg~
          <Img
          style={{
            width: 20,
            aspectRatio: 1.774,
            backgroundColor: color.step500
          }}
          src="https://devmonster.co.kr/static/media/main-bg-05.d88f30e7.png"></Img>
      </Button>
      <Button color={color.primary} fill="outline" style={{ marginBottom: 8 }}>
        outline
      </Button>

      <Button color={color.primary} fill="translucent">
        translucent
      </Button>

      <P>gap Test1</P>
      <Div style={{ borderColor: 'green', borderWidth: 1 }}>
        <Div style={{ flexDirection: 'row', borderColor: 'blue', borderWidth: 1, margin: -4 }}>
          <Div style={{ margin: 4, backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
          <Div style={{ margin: 4, backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
          <Div style={{ margin: 4, backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
          <Div style={{ margin: 4, backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
          <Div style={{ margin: 4, backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
          <Div style={{ margin: 4, backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
        </Div>
      </Div>

      <P>gap Test2</P>
      <Div style={{ borderColor: 'green', borderWidth: 1, flexDirection: 'row', gap: 8 }}>
        <Div style={{ backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
        <Div style={{ backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
        <Div style={{ backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
        <Div style={{ backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
        <Div style={{ backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
        <Div style={{ backgroundColor: 'red', flex: 1, aspectRatio: 1 }}></Div>
      </Div>
    </Div>
  )
}

export default TagsEx;

1.12.1

4 months ago

1.12.0

4 months ago

1.12.12

4 months ago

1.11.45

4 months ago

1.12.11

4 months ago

1.12.14

4 months ago

1.11.43

4 months ago

1.12.13

4 months ago

1.11.44

4 months ago

1.11.4

4 months ago

1.11.41

4 months ago

1.11.42

4 months ago

1.11.3

5 months ago

1.11.2

5 months ago

1.11.1

5 months ago

1.11.0

5 months ago

1.10.59

7 months ago

1.10.57

7 months ago

1.10.58

7 months ago

1.10.55

9 months ago

1.10.56

7 months ago

1.10.53

9 months ago

1.10.54

9 months ago

1.10.40

11 months ago

1.10.41

11 months ago

1.10.48

11 months ago

1.10.49

11 months ago

1.10.46

11 months ago

1.10.47

11 months ago

1.10.45

11 months ago

1.10.42

11 months ago

1.10.43

11 months ago

1.10.39

11 months ago

1.10.51

11 months ago

1.10.50

11 months ago

1.10.37

12 months ago

1.10.38

12 months ago

1.10.35

12 months ago

1.10.36

12 months ago

1.10.33

12 months ago

1.10.34

12 months ago

1.10.32

1 year ago

1.10.31

1 year ago

1.10.30

1 year ago

1.10.27

1 year ago

1.10.28

1 year ago

1.10.29

1 year ago

1.10.26

1 year ago

1.10.24

1 year ago

1.10.25

1 year ago

1.10.22

1 year ago

1.10.23

1 year ago

1.10.21

1 year ago

1.10.5

1 year ago

1.10.4

1 year ago

1.10.3

1 year ago

1.10.2

1 year ago

1.10.8

1 year ago

1.10.7

1 year ago

1.10.6

1 year ago

1.10.1

1 year ago

1.10.20

1 year ago

1.10.15

1 year ago

1.10.16

1 year ago

1.10.13

1 year ago

1.10.14

1 year ago

1.10.11

1 year ago

1.10.12

1 year ago

1.10.10

1 year ago

1.10.19

1 year ago

1.10.17

1 year ago

1.10.18

1 year ago

1.8.2

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.7.10

1 year ago

1.7.11

1 year ago

1.7.12

1 year ago

1.7.13

1 year ago

1.7.14

1 year ago

1.9.9

1 year ago

1.9.8

1 year ago

1.9.7

1 year ago

1.7.9

1 year ago

1.9.6

1 year ago

1.7.8

1 year ago

1.9.5

1 year ago

1.7.7

1 year ago

1.5.9

1 year ago

1.9.4

1 year ago

1.7.6

1 year ago

1.5.8

1 year ago

1.9.3

1 year ago

1.7.5

1 year ago

1.5.7

1 year ago

1.9.2

1 year ago

1.7.4

1 year ago

1.5.6

1 year ago

1.9.1

1 year ago

1.7.3

1 year ago

1.5.5

1 year ago

1.7.2

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.8.9

1 year ago

1.8.8

1 year ago

1.8.7

1 year ago

1.6.9

1 year ago

1.8.6

1 year ago

1.6.8

1 year ago

1.8.5

1 year ago

1.6.7

1 year ago

1.8.4

1 year ago

1.6.6

1 year ago

1.8.3

1 year ago

1.6.5

1 year ago

1.10.0

1 year ago

1.5.4

1 year ago

1.5.3

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.9

1 year ago

1.4.8

1 year ago

1.4.7

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago