1.1.1 • Published 8 months ago

ks-layout v1.1.1

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

설치

$ npm install ks-layout
or
$ yarn add ks-layout

Container

Props

type ContainerProps = {
  children?: ReactNode;
  minWidth?: number;
  maxWidth?: number;
  padding?:
    | number
    | { top?: number; right?: number; bottom?: number; left?: number };
  margin?:
    | number
    | { top?: number; right?: number; bottom?: number; left?: number };
  ...divElementTypes
};

Example

import { Container } from 'ks-layout';

const Demo = () => {
  return (
    <Container maxWidth={100} minWidth={100} padding={{ top: 200 }}>
      <div>
        <h1>Test</h1>
      </div>
    </Container>
  );
};

export default Demo;

Flex

Props

type FlexProps = {
  children?: ReactNode;
  minWidth?: number;
  maxWidth?: number;
  padding?:
    | number
    | { top?: number; right?: number; bottom?: number; left?: number };
  margin?:
    | number
    | { top?: number; right?: number; bottom?: number; left?: number };
  alignItems?: Property.AlignItems;
  alignContent?: Property.AlignContent;
  alignSelf?: Property.AlignSelf;
  justifyContent?: Property.JustifyContent;
  justifyItems?: Property.JustifyItems;
  justifySelf?: Property.JustifySelf;
  flexDirection?: Property.FlexDirection;
  flexWrap?: Property.FlexWrap;
  ...divElementTypes
};

Example

import { Flex } from 'ks-layout';

const Demo = () => {
  return (
    <Flex
      maxWidth={100}
      minWidth={100}
      padding={{ top: 200 }}
      alignItems="center"
      justifyContent="center"
      flexDirection="column"
    >
      <div>
        <h1>Test</h1>
      </div>
    </Flex>
  );
};

export default Demo;

Grid

Props

type GridProps = {
  children?: ReactNode;
  minWidth?: number;
  maxWidth?: number;
  padding?:
    | number
    | { top?: number; right?: number; bottom?: number; left?: number };
  margin?:
    | number
    | { top?: number; right?: number; bottom?: number; left?: number };
  row?: number;
  column?: number;
  gap?: {
    row?: number;
    column?: number;
  };
  ...divElementTypes
};

Example

import { Grid } from 'ks-layout';

const Demo = () => {
  return (
    <Grid
      maxWidth={100}
      minWidth={100}
      padding={{ top: 200 }}
      row={3}
      column={2}
      gap={{ row: 30, column: 20 }}
    >
      <div>
        <h1>Test</h1>
      </div>
    </Grid>
  );
};

export default Demo;
1.1.1

8 months ago

1.1.0

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago