A composable node component for Vue Flow-based canvases with Card-based styling.
The Node component provides a composable, Card-based node for Vue Flow canvases.
It includes support for connection handles, structured layouts, and consistent styling using shadcn/vue components.
The Node component is designed to be used with the Canvas component. See the Workflow demo for a full example.
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import CardContent from '@repo/shadcn-vue/components/ui/card/CardContent.vue'
import { cn } from '@repo/shadcn-vue/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<CardContent :class="cn('p-3', props.class)">
<slot />
</CardContent>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import CardFooter from '@repo/shadcn-vue/components/ui/card/CardFooter.vue'
import { cn } from '@repo/shadcn-vue/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<CardFooter :class="cn('rounded-b-md border-t bg-secondary p-3!', props.class)">
<slot />
</CardFooter>
</template>
export { default as Node } from './Node.vue'
export { default as NodeAction } from './NodeAction.vue'
export { default as NodeContent } from './NodeContent.vue'
export { default as NodeDescription } from './NodeDescription.vue'
export { default as NodeFooter } from './NodeFooter.vue'
export { default as NodeHeader } from './NodeHeader.vue'
export { default as NodeTitle } from './NodeTitle.vue'