You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Futhemore, we discovered that [Motion One](https://motion.dev/vue/quick-start), a Web Animations API based animation library works perfectly with Oku Primitives.
92
+
Futhemore, we discovered that [Motion One](https://motion.oku-ui.com), a Web Animations API based animation library works perfectly with Oku Primitives.
93
93
94
-
Check out this [Stackblitz Demo](https://stackblitz.com/edit/hfxgtx-n6jbjp?file=src%2FApp.vue) 🤩
95
94
:::
96
95
97
96
## Delegating unmounting for JavaScript Animation
@@ -156,5 +155,5 @@ watch(open, () => {
156
155
```
157
156
158
157
::: tip
159
-
Check out this [Stackblitz Demo](https://stackblitz.com/edit/macsaz?file=src%2FApp.vue)
Copy file name to clipboardExpand all lines: .docs/content/guides/composition.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
1
---
2
2
3
3
title: Composition
4
-
description: Use the `asChild` prop to compose Radix's functionality onto alternative element types or your own Vue components.
4
+
description: Use the `as` prop to compose Radix's functionality onto alternative element types or your own Vue components.
5
5
---
6
6
7
7
# Composition
8
8
9
9
<Description>
10
-
Use the `asChild` prop to compose Radix's functionality onto alternative
10
+
Use the `as` prop to compose Radix's functionality onto alternative
11
11
element types or your own Vue components.
12
12
</Description>
13
13
14
-
All Radix primitive parts that render a DOM element accept an `asChild` prop. When `asChild` is set to `true`, Oku Primitives will not render a default DOM element, instead passing the props and behavior required to make it functional to the first child of the slots.
14
+
All Radix primitive parts that render a DOM element accept an `as` prop. When `as` is set to `true`, Oku Primitives will not render a default DOM element, instead passing the props and behavior required to make it functional to the first child of the slots.
15
15
16
16
## Changing the element type
17
17
18
18
In the majority of cases you shouldn’t need to modify the element type as Radix has been designed to provide the most appropriate defaults. However, there are cases where it is helpful to do so.
19
19
20
-
A good example is with `TooltipTrigger`. By default this part is rendered as a `button`, though you may want to add a tooltip to a link (`a` tag) as well. Let's see how you can achieve this using `asChild`:
20
+
A good example is with `TooltipTrigger`. By default this part is rendered as a `button`, though you may want to add a tooltip to a link (`a` tag) as well. Let's see how you can achieve this using `as`:
The Oku Primitives design pattern involves creating individual primitives for each component, allowing users to construct or [compose](./composition) components as they wish.
4
+
5
+
However, importing all the necessary components individually can be cumbersome, and users might occasionally forget to import an important component.
6
+
7
+
To address this issue, we’ve introduced [Namespaced components](https://vuejs.org/api/sfc-script-setup.html#namespaced-components).
8
+
9
+
## How to use?
10
+
11
+
First, you need to import the namespaced components via `@oku-ui/primitives/namespaced` in your Vue component.
12
+
13
+
```vue line=2
14
+
<script setup lang="ts">
15
+
import { Dialog, DropdownMenu } from '@oku-ui/primitives/namespaced'
16
+
</script>
17
+
```
18
+
19
+
Then, you can use all the relevant components within the namespace.
20
+
21
+
```vue line=6-17
22
+
<script setup lang="ts">
23
+
import { Dialog } from '@oku-ui/primitives/namespaced'
0 commit comments