Skip to content

Components

IONFLOW Frontend uses a combination of PrimeVue components and custom Vue components organized by functionality.

  1. PrimeVue First: Always use PrimeVue components when available
  2. Reusability: Create custom components only when truly needed
  3. Type Safety: All props and emits must be typed
  4. Testing: Components in src/components/ must have unit tests
CategoryLocationDescription
UIsrc/components/common/Generic utility components
Formssrc/components/Form-related components
Layoutsrc/components/Layout and structural components
Featuressrc/components/[feature]/Feature-specific components
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 editor

PrimeVue components are auto-imported and styled via Volt theme. Common components include:

  • InputText, InputNumber, Textarea, Password
  • Checkbox, RadioButton, ToggleSwitch
  • Select, MultiSelect, AutoComplete
  • DatePicker, ColorPicker, Slider
  • Button, ButtonGroup, SplitButton, SpeedDial
  • DataTable, DataView, Tree, TreeTable
  • Timeline, Paginator
  • Card, Panel, Accordion, Tabs
  • Dialog, Drawer, Popover
  • Toast, Message, ProgressBar, Skeleton
ScenarioAction
PrimeVue has itUse 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/
<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>

For components in src/components/:

ComponentName/
├── ComponentName.vue # Main component
├── ComponentName.spec.ts # Unit tests (required)
└── types.ts # Local types (if complex)
  • 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’t duplicate PrimeVue functionality
  • Don’t use any type
  • Don’t create components for single use
  • Don’t add inline styles
  • Don’t skip tests for common components