Skip to content

Commit 4a18345

Browse files
authored
feat: enhance ComponentLoader with resizable panels (#36)
1 parent e9cd2e7 commit 4a18345

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

apps/www/components/ComponentLoader.vue

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
<script lang="ts" setup>
2+
import {
3+
ResizableHandle,
4+
ResizablePanel,
5+
ResizablePanelGroup,
6+
} from '@repo/shadcn-vue/components/ui/resizable'
7+
28
interface Props {
39
componentName?: string
410
id?: string
@@ -21,8 +27,20 @@ withDefaults(defineProps<Props>(), {
2127
:label="label || componentName"
2228
icon="lucide:laptop-minimal"
2329
>
24-
<ComponentViewer :component-name="componentName" />
30+
<ResizablePanelGroup direction="horizontal">
31+
<ResizablePanel :default-size="100">
32+
<div class="h-[600px] overflow-auto">
33+
<ComponentViewer :component-name="componentName" />
34+
</div>
35+
</ResizablePanel>
36+
<ResizableHandle
37+
class="translate-x-px border-none [&>div]:shrink-0"
38+
with-handle
39+
/>
40+
<ResizablePanel :default-size="0" />
41+
</ResizablePanelGroup>
2542
</div>
43+
2644
<CodeViewerTab
2745
v-bind="$props"
2846
label="Code"

0 commit comments

Comments
 (0)