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

shintarou

v0.0.34

Published

shintarou/新太郎 is a react component that helps to create a layout easily. It supports normal div, flexbox and grid.

Downloads

79

Readme

shintarou/新太郎

shintarou/新太郎 is an npm package to make building web layout easy. This lib has 3 components to create a web ui for reactjs app. shintarou is easy to install and to use.

requirements

  • nodejs: v16.9 - v18
  • package manager: npm/yarn/pnpm

How to install

# npm
npm install shintarou

# yarn
yarn add shintarou

# pnpm
pnpm add shintarou

How to use shintarou/新太郎

Box

Box is the same as div but you don't need to use style={{css}} for styling a div. You can pass backgroundColor, width, height etc as props.

import { Box } from 'shintarou'

interface MyFirstBoxProps {
  title: string
  backgroundColor: string
}

export function MyFirstBox({ title, backgroundColor}: MyFirstBoxProps): JSX.Element {
  return (
    <Box backgroundColor={backgroundColor} width="20rem" height="20rem">{title}</Box>
  )
}

codesandbox
https://codesandbox.io/p/sandbox/shintarou-box-8s737k

Flex

Flex is div with flex box.

import { Box, DIRECTION_COLUMN, DIRECTION_ROW, Flex } from "shintarou";

interface MyFirstFlex {
  direction: string;
}

export function MyFirstFlex({ direction }: MyFirstFlex): JSX.Element {
  return (
    <Flex
      flexDirection={direction === "col" ? DIRECTION_COLUMN : DIRECTION_ROW}
      gridGap="1rem"
    >
      <Box width="10rem" height="10rem" backgroundColor="#ff00ff" />
      <Box width="10rem" height="10rem" backgroundColor="#0000ff" />
      <Box width="10rem" height="10rem" backgroundColor="#ff0000" />
    </Flex>
  );
}

codesandbox
https://codesandbox.io/p/sandbox/shintarou-flex-5jdj4k

Grid

Grid is div with grid.

import { Box, Grid } from "shintarou";

export function MyFirstGrid(): JSX.Element {
  return (
    <Grid
      gridTemplateColumns="auto auto auto"
      padding="1rem"
      color="black"
      gridGap="1rem"
    >
      <Box width="10rem" height="10rem" backgroundColor="#ff00ff">
        1
      </Box>
      <Box width="10rem" height="10rem" backgroundColor="#0650ff">
        2
      </Box>
      <Box width="10rem" height="10rem" backgroundColor="#af030a">
        3
      </Box>
      <Box width="10rem" height="10rem" backgroundColor="#ffaaff">
        4
      </Box>
      <Box width="10rem" height="10rem" backgroundColor="#0000ff">
        5
      </Box>
      <Box width="10rem" height="10rem" backgroundColor="#dadada">
        6
      </Box>
    </Grid>
  );
}

codesandbox
https://codesandbox.io/p/sandbox/shintarou-grid-v85pny

support props

export interface ColorProps {
  color?: string
  backgroundColor?: string
  opacity?: string | number
}

export interface TypographyProps {
  fontSize?: string | number
  fontWeight?: string | number
  fontStyle?: string
  lineHeight?: string | number
  textAlign?: string
  textTransform?: string
  textDecoration?: string
}

export interface SpacingProps {
  margin?: string | number
  marginX?: string | number
  marginY?: string | number
  marginTop?: string | number
  marginRight?: string | number
  marginBottom?: string | number
  marginLeft?: string | number
  padding?: string | number
  paddingX?: string | number
  paddingY?: string | number
  paddingTop?: string | number
  paddingRight?: string | number
  paddingBottom?: string | number
  paddingLeft?: string | number
}

export interface BorderProps {
  border?: string
  borderTop?: string
  borderRight?: string
  borderBottom?: string
  borderLeft?: string
  borderRadius?: string | number
  borderWidth?: string | number
  borderColor?: string
  boxShadow?: string
}

export interface FlexboxProps {
  flex?: string | number
  alignItems?: string
  alignSelf?: string
  justifyContent?: string
  flexDirection?: string
  flexWrap?: string
  flexFlow?: string
  alignContent?: string
  whiteSpace?: string
}

export interface GridProps {
  columnGap?: string | number
  rowGap?: string | number
  gridGap?: string | number
  gridTemplateAreas?: string
  gridTemplateRows?: string
  gridTemplateColumns?: string
  gridArea?: string | number
  gridRow?: string | number
  gridColumn?: string | number
}

export interface LayoutProps {
  display?: string
  size?: string | number
  width?: string | number
  minWidth?: string | number
  maxWidth?: string | number
  height?: string | number
  minHeight?: string | number
  maxHeight?: string | number
  overflow?: CSSProperties['overflow']
  overflowX?: CSSProperties['overflowX']
  overflowY?: CSSProperties['overflowY']
  wordSpacing?: string | number
  cursor?: CSSProperties['cursor']
  overflowWrap?: string
}

export interface PositionProps {
  position?: string
  zIndex?: string | number
  top?: string | number
  right?: string | number
  bottom?: string | number
  left?: string | number
  transform?: string
  transformOrigin?: CSSProperties['transformOrigin']
}