Gathering detailed insights and metrics for @mir4a/resize-container-react
Gathering detailed insights and metrics for @mir4a/resize-container-react
Gathering detailed insights and metrics for @mir4a/resize-container-react
Gathering detailed insights and metrics for @mir4a/resize-container-react
A simple React component to resize a container. Fully customizable. Zero dependencies.
npm install @mir4a/resize-container-react
Typescript
Module System
Node Version
NPM Version
TypeScript (88.84%)
JavaScript (5.88%)
CSS (4.29%)
HTML (0.99%)
Total Downloads
605
Last Day
1
Last Week
4
Last Month
13
Last Year
126
54 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Apr 24, 2024
Latest Version
1.0.2-pre3
Package Id
@mir4a/resize-container-react@1.0.2-pre3
Unpacked Size
68.04 kB
Size
9.18 kB
File Count
39
NPM Version
8.19.3
Node Version
16.19.1
Published on
Mar 06, 2023
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
4
Compared to previous week
Last Month
160%
13
Compared to previous month
Last Year
-8%
126
Compared to previous year
1
38
A simple React component to resize a container. Fully customizable. Zero dependencies.
1npm install --save @mir4a/resize-container-react
1import React from 'react' 2import {ResizeContainer, ResizeBothHandle} from '@mir4a/resize-container-react' 3 4const App = () => { 5 return ( 6 <ResizeContainer> 7 <p> 8 Any content here 9 </p> 10 <ResizeBothHandle /> 11 </ResizeContainer> 12 ) 13}
1import React from 'react' 2import {ResizeContainer, ResizeBothHandle} from '@mir4a/resize-container-react' 3 4const App = () => { 5 return ( 6 <ResizeContainer 7 style={{ 8 width: '100%', 9 height: '100%', 10 backgroundColor: 'yellow', 11 }} 12 > 13 <p style={{ 14 width: 'inherit', 15 height: 'inherit', 16 overflow: 'auto', 17 }}> 18 Any content here 19 </p> 20 <ResizeBothHandle> 21 <img src="https://img.icons8.com/ios/50/000000/resize.png" /> 22 </ResizeBothHandle> 23 </ResizeContainer> 24 ) 25}
automatic detection is not supported yet
1import React from 'react' 2import {ResizeContainer, ResizeBothHandle} from '@mir4a/resize-container-react' 3 4const App = () => { 5 return ( 6 <div dir="rtl"> 7 <ResizeContainer 8 isRTL={true} 9 > 10 <p style={{ 11 width: 'inherit', 12 height: 'inherit', 13 overflow: 'auto', 14 }}> 15 Any content here 16 </p> 17 <ResizeBothHandle> 18 <img src="https://img.icons8.com/ios/50/000000/resize.png" /> 19 </ResizeBothHandle> 20 </ResizeContainer> 21 </div> 22 ) 23}
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | null | any of your content |
style? | CSSProperties | {} | any css styles |
initialWidth? | number | undefined | Initial width of the container |
initialHeight? | number | undefined | Initial height of the container |
onResize? | ({width: number, height: number}) => void | undefined | Callback function fired while container is resizing |
onResizeEnd? | ({width: number, height: number}) => void | undefined | Callback function when the container is resized |
Prop | Type | Default | Description |
---|---|---|---|
children? | ReactNode | null | custom icon or whatever component to use as resize handle |
style? | CSSProperties | {} | override default position and other styles |
Prop | Type | Default | Description |
---|---|---|---|
children? | ReactNode | null | custom icon or whatever component to use as resize handle |
style? | CSSProperties | {} | override default position and other styles |
Prop | Type | Default | Description |
---|---|---|---|
children? | ReactNode | null | custom icon or whatever component to use as resize handle |
style? | CSSProperties | {} | override default position and other styles |
onResize
callback returns negative values when resizing collapses the container.ISC
No vulnerabilities found.