Gathering detailed insights and metrics for mantine-vaul
Gathering detailed insights and metrics for mantine-vaul
Gathering detailed insights and metrics for mantine-vaul
Gathering detailed insights and metrics for mantine-vaul
Mantine port of Vaul drawer component optimized for mobile devices.
npm install mantine-vaul
Typescript
Module System
Node Version
NPM Version
44.7
Supply Chain
89.1
Quality
85.6
Maintenance
100
Vulnerability
99.6
License
TypeScript (90.16%)
CSS (5.01%)
JavaScript (4.01%)
HTML (0.82%)
Total Downloads
2,820
Last Day
3
Last Week
7
Last Month
57
Last Year
2,820
5 Stars
39 Commits
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.5.6
Package Id
mantine-vaul@0.5.6
Unpacked Size
233.94 kB
Size
38.58 kB
File Count
112
NPM Version
10.7.0
Node Version
22.2.0
Publised On
24 Sept 2024
Cumulative downloads
Total Downloads
Last day
200%
3
Compared to previous day
Last week
0%
7
Compared to previous week
Last month
147.8%
57
Compared to previous month
Last year
0%
2,820
Compared to previous year
1
4
30
A drawer component library for mobile devices, leveraging the power of Vaul for seamless integration.
Library works only with mantine v7.9.0+
pnpm add mantine-vaul @mantine/core @mantine/hooks
Only Vaul:
1import "mantine-vaul/style.css"; 2import { Box, Button, Text } from "@mantine/core"; 3import { Vaul } from "mantine-vaul"; 4 5export const App = () => { 6 return ( 7 <div> 8 <Box> 9 <Vaul 10 title="Vaul" 11 target={<Vaul.Target component={Button}>Open vaul</Vaul.Target>} 12 > 13 <Box maw="600px" mx="auto"> 14 <Text> 15 This component can be used as a Dialog replacement on mobile and 16 tablet devices. You can read about why and how it was built{" "} 17 </Text> 18 </Box> 19 </Vaul> 20 </Box> 21 </div> 22 ); 23};
Responsive dialog: (Show vaul, classic drawer or classic dialog by responsive breakpoint)
1import "mantine-vaul/style.css"; 2import { Box, Button, Text } from "@mantine/core"; 3import { ResponsiveDialog } from "mantine-vaul"; 4 5const resposiveDialogMatches = { 6 base: "vaul", 7 lg: "modal", 8 xl: "drawer", 9}; 10 11export const App = () => { 12 const [open, setOpen] = useState<boolean>(false); 13 14 return ( 15 <div> 16 <Button onClick={() => setOpen(true)}>Open</Button> 17 <Box> 18 <ResponsiveDialog 19 opened={open} 20 onClose={() => setOpen(false)} 21 title="Vaul" 22 matches={resposiveDialogMatches} 23 > 24 <Box maw="600px" mx="auto"> 25 <Text> 26 This component can be used as a Dialog replacement on mobile and 27 tablet devices. You can read about why and how it was built{" "} 28 </Text> 29 </Box> 30 </ResponsiveDialog> 31 </Box> 32 </div> 33 ); 34};
opened
: This prop determines whether the drawer is currently open or closed. When set to true, the drawer is displayed in the open state, while setting it to false closes the drawer.
onOpenChange
: Called when vaul is closed or opened.
closeThreshold
: Number between 0 and 1 that determines when the drawer should be closed. Example: threshold of 0.5 would close the drawer if the user swiped for 50% of the height of the drawer or more.
scrollLockTimeout
: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
snapPoints
: Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Example [0.2, 0.5, 0.8]. You can also use px values, which doesn't take screen height into account.
fadeFromIndex
: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
direction
: Direction of the drawer. Can be top or bottom, left, right. Defaults to bottom.
shadow
, radius
... and more
No vulnerabilities found.
No security vulnerabilities found.