Components
Components
Section titled “Components”IONFLOW Frontend uses a combination of PrimeVue components and custom Vue components organized by functionality.
Component Philosophy
Section titled “Component Philosophy”- PrimeVue First: Always use PrimeVue components when available
- Reusability: Create custom components only when truly needed
- Type Safety: All props and emits must be typed
- Testing: Components in
src/components/must have unit tests
Component Categories
Section titled “Component Categories”| Category | Location | Description |
|---|---|---|
| UI | src/components/common/ | Generic utility components |
| Forms | src/components/ | Form-related components |
| Layout | src/components/ | Layout and structural components |
| Features | src/components/[feature]/ | Feature-specific components |
Directory Structure
Section titled “Directory Structure”src/components/├── common/ # Generic utility components│ ├── CustomToggle.vue│ ├── GitBranch.vue│ ├── HeaderView.vue│ ├── TitleHeader.vue│ └── TruncateText.vue├── connections/ # Connection components├── execution/ # Execution components├── workflow/ # Workflow builder components├── webhook/ # Webhook components├── Header/ # Application header├── SideBar/ # Navigation sidebar└── Editor/ # Monaco JSON editorPrimeVue Components
Section titled “PrimeVue Components”PrimeVue components are auto-imported and styled via Volt theme. Common components include:
Form Inputs
Section titled “Form Inputs”InputText,InputNumber,Textarea,PasswordCheckbox,RadioButton,ToggleSwitchSelect,MultiSelect,AutoCompleteDatePicker,ColorPicker,Slider
Buttons & Actions
Section titled “Buttons & Actions”Button,ButtonGroup,SplitButton,SpeedDial
Data Display
Section titled “Data Display”DataTable,DataView,Tree,TreeTableTimeline,Paginator
Panels & Containers
Section titled “Panels & Containers”Card,Panel,Accordion,TabsDialog,Drawer,Popover
Feedback
Section titled “Feedback”Toast,Message,ProgressBar,Skeleton
Creating New Components
Section titled “Creating New Components”When to Create
Section titled “When to Create”| Scenario | Action |
|---|---|
| PrimeVue has it | Use PrimeVue component |
| Generic utility (reusable 3+ times) | Create in src/components/common/ |
| Feature-specific (2+ times) | Create in src/components/[feature]/ |
| Domain-specific (1 time) | Create in src/views/[domain]/components/ |
Component Template
Section titled “Component Template”<script setup lang="ts">import { ref, computed } from 'vue';
type Props = { title: string; items?: Item[];};
const props = withDefaults(defineProps<Props>(), { items: () => [],});
type Emits = { select: [item: Item];};
const emit = defineEmits<Emits>();
const handleSelect = (item: Item) => { emit('select', item);};</script>
<template> <div class="component-wrapper"> <!-- Component content --> </div></template>Required Files
Section titled “Required Files”For components in src/components/:
ComponentName/├── ComponentName.vue # Main component├── ComponentName.spec.ts # Unit tests (required)└── types.ts # Local types (if complex)Component Guidelines
Section titled “Component Guidelines”Do’s ✅
Section titled “Do’s ✅”- Use PrimeVue components as base
- Type all props and emits
- Use Tailwind for styling
- Add unit tests for common components
- Use composables for shared logic
Don’ts ❌
Section titled “Don’ts ❌”- Don’t duplicate PrimeVue functionality
- Don’t use
anytype - Don’t create components for single use
- Don’t add inline styles
- Don’t skip tests for common components