Skip to content
Component selection and contracts | Omni Manual Book

Component selection and contracts

Verified ERP Vue component APIs, ownership boundaries, composition rules, and component acceptance states.

The identifiers below refer to frontend/src/components/ui, inspected on 2026-09-05. They do not imply that similarly named exports in packages/ui-shared have identical APIs. Read the owning implementation and colocated tests before changing a call site. These are usage contracts and review targets, not a claim that every state is tested or accessible.

These links open actual Vue components in an isolated sandbox. They do not call production APIs.

NeedExisting componentCaller responsibility
Execute an actionBaseButtonLabel, permission, request lifecycle, result feedback
Edit a scalar valueBaseInput, BaseTextareaDomain validation, parsing, persistence
Choose a valueBaseSelect, SearchableSelectAuthorized options and selected-label resolution
Blocking taskBaseModalTask content, safe dismissal, focus after completion
Consequential confirmationConfirmGateConsequence copy, busy state, actual mutation
Managed resource listDataTable and DataTablePagerServer query, selection, bulk API, export scope
No recordsEmptyStateCorrect reason and permission-aware next action
Context explanationHelpPopover, BaseTooltipAppropriate detail and accessible trigger
Record stateStatusBadgeAccurate business state and any explicit tone
Loading structureSkeletonFetch state, region announcement, eventual error

BaseButton.variant accepts primary, secondary, ghost, or danger. size accepts sm, md, or lg; type accepts button, submit, or reset. The default type is button: declare type="submit" for a real form submission. loading disables the native button and sets aria-busy; it does not perform or cancel the request. disabled and block are separate props; content belongs in the default slot. No label, icon, or success variant was verified in this ERP contract.

Example: a save action uses type="submit", :loading="saving", and localized visible slot text. Keep the label meaningful during loading; the spinner alone cannot explain what is happening. Use a link for navigation rather than assuming every navigation destination is a button action.

BaseInput accepts modelValue, label, type, placeholder, autocomplete, and list. It also accepts required, disabled, error, hint, and info. It emits update:modelValue and blur, and exposes focus() for deliberate focus management. Its generated ID connects the label; a passed id is not forwarded to the inner input. Use the exposed method rather than guessing the generated ID when focusing an invalid field. The append slot is available; do not use it to hide a unit or mandatory instruction.

SearchableSelect options contain value, label, and optional description, keywords, and disabled. Its fetch contract receives search, optional cursors, and pageSize, and returns options plus cursor metadata. optionLabel resolves a selected value outside the loaded window; searchDebounce defaults to 300ms. create, createPermission, and the created event support configured creation workflows. Do not confuse creatable free-form values with creating a persisted master-data record.

BaseModal uses open with update:open, plus title, subtitle, closable, and width. It also emits close; the normal binding is v-model:open, not an invented visible prop. The component implements focus management, but the caller must test its actual overlay composition. closable=false is not a generic solution to unreliable networking; provide a recovery path.

ConfirmGate requires title and message, and emits confirm. Its default slot exposes open and disabled; it owns its dialog state internally. Optional props include confirmLabel, cancelLabel, confirmVariant, requireText, requireTextLabel, disabled, and busy. The inspected implementation closes its dialog before emitting confirm. Therefore busy is not evidence that the dialog stays open until a promise resolves. The caller must retain visible progress and errors after the dialog closes.

EmptyState.message is canonical; description is an existing legacy alias. Use permission, a derived canCreate, createLabel, and either createTo or the create event as appropriate. In the inspected implementation, canCreate=true overrides; false does not deny access when permission resolves true. Do not use canCreate=false as a security boundary or assume it always suppresses the CTA.

StatusBadge takes value, optional tone, and size of sm or md. Tone values are neutral, info, success, warning, and danger; state remains the source of meaning. HelpPopover requires content; optional props include title, placement, label, and docsUrl. docsUrl is a documentation slug used by the resolver, not a promise of arbitrary external URL support. BaseTooltip supports content, placement, disabled, wide, and a content slot. Skeleton supports inline, circle, width, height, and rows; it does not fetch data.

DoDo notReason
Reuse an existing primitive and extend its documented contractFork a page-local button or modalAvoid divergent behavior and fixes
Keep domain rules in a service or domain boundaryAdd payroll calculations to BaseInputPreserve single responsibility
Pass typed data and emit narrow eventsLet a generic control fetch arbitrary module dataKeep dependencies explicit
Check both ownership and APITreat shared-package and ERP components as interchangeableSimilar names are not compatibility guarantees
Document tested states and gapsCall a component certified because it has a storyEvidence is state-specific
  • Props, events, slots, and ownership match the current source rather than another library’s conventions.
  • Default, loading, disabled, error, empty, read-only, and long-content states are considered where relevant.
  • Both locales, keyboard operation, narrow layout, dark theme, and reduced motion are reviewed.
  • Permission and persistence remain outside visual primitives and are enforced server-side.
  • New shared behavior has colocated tests and a migration note for affected callers.
  • Stories use isolated providers and clearly labeled sandbox data, never production bootstrapping.

Continue with forms, feedback, and governance for integration decisions.