Overview
@empathyco/x-components is the main package of Interface X, providing a comprehensive set of Vue.js components for building powerful search and discovery experiences. It includes components, composables, directives, store modules, and utilities for creating e-commerce search interfaces.
Installation
Peer Dependencies
Vue.js framework version ^3.5.28
Vuex state management version 4.0.2
Main Exports
The package exports functionality from multiple areas:Components
Pre-built Vue components for search experiences including:- Search box components
- Results display components
- Facet components
- Recommendation components
- History and suggestion components
Composables
Vue 3 composition API utilities for:- State management
- Event handling
- Animation control
- Device detection
Directives
Custom Vue directives for enhanced functionality:- Infinite scroll
- Click outside detection
- Element visibility tracking
Store Modules
Vuex store modules for managing:- Search state
- Facets and filters
- User queries
- Recommendations
- Tagging and analytics
X-Modules
Core modules exported from the package:AI-powered search features
Device detection and responsive behavior
Query suggestions and autocomplete
Faceted search and filtering - See Module Details
Search history management - See Module Details
Product recommendations - See Module Details
Core search functionality - See Module Details
Analytics and tracking - See Module Details
URL synchronization - See Module Details
Basic Usage
Component Example
Configuration
Each module can be configured with specific options:TypeScript Support
The package includes full TypeScript definitions. Import types directly:Key Interfaces
Base interface for all X Components with event handling and state access
Interface for Vuex store modules including state, getters, mutations, and actions
Type definition for events in the X event bus system
Related Packages
- @empathyco/x-adapter - API adapter utilities
- @empathyco/x-types - TypeScript type definitions
- @empathyco/x-tailwindcss - Tailwind CSS plugin
- @empathyco/x-utils - Utility functions
Resources
Module Reference
Explore individual module documentation
GitHub Repository
View source code and examples
