0.0.15 • Published 2 years ago

react-breakpoints-id v0.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React BreakPoints Id

Breakpoints are customizable widths that determine how your responsive layout without render for Reactjs

Installation

npm i react-breakpoints-id

or

yarn add react-breakpoints-id

Usage Example

import React from 'react';
import BreakPoint from 'react-breakpoints-id';

export default function App() {
  return (
    <React.Fragment>
      <BreakPoint breakPoint={['xs']}>
        <p>Only XS</p>
      </BreakPoint>

      <BreakPoint breakPoint={['xs', 'md']}>
        <p>XS to MD</p>
      </BreakPoint>

      <BreakPoint valBreakPoint={{md: 500, lg: 700}} breakPoint={['xs', 'md']}>
        <p>Custom Value Break Point</p>
      </BreakPoint>
    </React.Fragment>
  );
}

Props

NoNameTypeDescriptionDefault ValueMandatory
1valBreakPointFor custom from width xs, sm, md, lg, xl, xxlobject{ xs: 0, sm: 576, md: 768, lg: 992, xl: 1200, xxl: 1400 }false
2breakPointTo determine the break point layout to be used. Example: if you use "xs" it means that the inner component will render when the device is 0px to 575px, if you use "md" it means that the inner component will render when the device is 768px to 991px, if you use "sm", "lg" means the inner component will render when the device is 576px to 991pxArray<'xs', 'sm', 'md', 'lg', 'xl', 'xxl'>-true

Break Points

Extra Small (xs)Small (sm)Medium (md)Large (lg)X-Large (xl)XX-Large (xxl)
0px to 575px576px to 767px768px to 991px992px to 1199px1200px to 1399px>= 1400px

Config For TypeScript

Add in file index.d.ts or global.d.ts

declare module 'react-breakpoints-id';

Live Preview

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago