Skip to content

Commit

Permalink
Merge branch 'emilkowalski:main' into feat/draghandle
Browse files Browse the repository at this point in the history
  • Loading branch information
rortan134 authored Jan 15, 2024
2 parents 60cfcf9 + baa3d44 commit 48a562b
Show file tree
Hide file tree
Showing 12 changed files with 821 additions and 464 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
https://github.com/emilkowalski/vaul/assets/36730035/fdf8c5e8-ade8-433b-8bb0-4ce10e722516

Vaul is an unstyled drawer component for React that can be used as a Dialog replacement on tablet and mobile devices. It uses [Radix's Dialog primitive](https://www.radix-ui.com/docs/primitives/components/dialog#trigger) under the hood and is inspired by [this tweet](https://twitter.com/devongovett/status/1674470185783402496).
Vaul is an unstyled drawer component for React that can be used as a Dialog replacement on tablet and mobile devices. You can read about why and how it was built [here](https://emilkowal.ski/ui/building-a-drawer-component).

## Usage

To start using the library, install it in your project:
To start using the library, install it in your project:,

```bash
npm install vaul
Expand Down Expand Up @@ -61,6 +61,8 @@ Additional props:

`modal`: When `false` it allows to interact with elements outside of the drawer without closing it. Defaults to `true`.

`preventScrollRestoration`: When `true` it prevents scroll restoration when the drawer is closed after a navigation happens inside of it. Defaults to `true`.

### Trigger

The button that opens the dialog. [Props](https://www.radix-ui.com/docs/primitives/components/dialog#trigger).
Expand Down
31 changes: 22 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
{
"name": "vaul",
"version": "0.7.9",
"version": "0.8.0",
"description": "Drawer component for React.",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsup src/index.tsx",
"dev": "tsup src/index.tsx --watch",
"build": "bunchee",
"dev": "bunchee --watch",
"dev:website": "turbo run dev --filter=website...",
"dev:test": "turbo run dev --filter=test...",
"format": "prettier --write .",
Expand All @@ -35,11 +45,14 @@
"devDependencies": {
"@playwright/test": "^1.37.1",
"@radix-ui/react-dialog": "^1.0.4",
"@types/react": "^18.2.46",
"bunchee": "^4.2.11",
"eslint": "^7.32.0",
"prettier": "^2.5.1",
"typescript": "5.2.2",
"tsup": "^6.4.0",
"turbo": "1.6"
"react": "18.2.0",
"react-dom": "18.2.0",
"turbo": "1.6",
"typescript": "5.2.2"
},
"peerDependencies": {
"react": "^16.8 || ^17.0 || ^18.0",
Expand Down
Loading

0 comments on commit 48a562b

Please sign in to comment.