Blame view

天文台pc/tianwentai-ui/node_modules/vaul/README.md 906 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  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. 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:,
  
  ```bash
  npm install vaul
  ```
  
  Use the drawer in your app.
  
  ```jsx
  import { Drawer } from 'vaul';
  
  function MyComponent() {
    return (
      <Drawer.Root>
        <Drawer.Trigger>Open</Drawer.Trigger>
        <Drawer.Portal>
          <Drawer.Content>
            <Drawer.Title>Title</Drawer.Title>
          </Drawer.Content>
          <Drawer.Overlay />
        </Drawer.Portal>
      </Drawer.Root>
    );
  }
  ```
  
  ## Documentation
  
  Find the full API reference and examples in the [documentation](https://vaul.emilkowal.ski/getting-started).