@hydrateless/vue 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,6 +46,36 @@ Available directives: `v-hl-accordion`, `v-hl-disclosure`, `v-hl-tabs`,
46
46
  `v-hl-toc`. You can also import individual directives (e.g. `vHlTabs`) and
47
47
  register them locally.
48
48
 
49
+ ## Components
50
+
51
+ Interactive components support `v-model` on their state:
52
+
53
+ ```vue
54
+ <script setup lang="ts">
55
+ import { ref } from 'vue';
56
+ import { Tabs, TabList, Tab, TabPanel, Modal, ModalBody } from '@hydrateless/vue';
57
+
58
+ const tab = ref('overview');
59
+ const open = ref(false);
60
+ </script>
61
+
62
+ <template>
63
+ <Tabs v-model="tab">
64
+ <TabList>
65
+ <Tab value="overview">Overview</Tab>
66
+ <Tab value="install">Install</Tab>
67
+ </TabList>
68
+ <TabPanel>Zero runtime by default.</TabPanel>
69
+ <TabPanel><code>npm i hydrateless</code></TabPanel>
70
+ </Tabs>
71
+
72
+ <button @click="open = true">Open</button>
73
+ <Modal v-model:open="open">
74
+ <ModalBody>Body content.</ModalBody>
75
+ </Modal>
76
+ </template>
77
+ ```
78
+
49
79
  ## Composables
50
80
 
51
81
  ```vue
@@ -55,9 +85,10 @@ import { useEnhancer, useToast } from '@hydrateless/vue';
55
85
  import { enhanceDropdown } from '@hydrateless/enhancers';
56
86
 
57
87
  const menu = ref<HTMLElement | null>(null);
58
- useEnhancer(menu, enhanceDropdown);
88
+ const dropdown = useEnhancer(menu, enhanceDropdown);
89
+ // dropdown.value?.setOpen(true)
59
90
 
60
- const toast = useToast();
91
+ const toast = useToast(); // no provider required
61
92
  </script>
62
93
 
63
94
  <template>