tait-ui-components
v1.0.0
Published
Tait UI Component Library - Reusable Vue 3 components
Maintainers
Readme
Tait UI Components Library
A comprehensive Vue 3 component library built with TypeScript, PrimeVue, and SCSS.
📚 Documentation
- GETTING_STARTED.md - Bắt đầu sử dụng (Chọn file phù hợp)
- USAGE_GUIDE.md - Hướng dẫn sử dụng chi tiết (Tiếng Việt)
- COMPONENTS_INDEX.md - Danh mục tìm kiếm components
- QUICK_START.md - Hướng dẫn nhanh 5 phút
- PUBLISH.md - Hướng dẫn publish và sử dụng
- CHANGELOG.md - Lịch sử thay đổi
📦 Installation
npm install @tait/ui-components🚀 Quick Start
1. Install Dependencies
npm install vue@^3.0.0 primevue@^3.0.0 primeicons2. Import and Use
// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import TaitUI from '@tait/ui-components'
import 'primevue/resources/themes/saga-blue/theme.css'
import 'primevue/resources/primevue.min.css'
import 'primeicons/primeicons.css'
import '@tait/ui-components/dist/styles/index.css'
const app = createApp(App)
app.use(TaitUI)
app.mount('#app')3. Use Components
<template>
<div>
<!-- Basic Components -->
<DaButton label="Click me" />
<DaInputText v-model="text" placeholder="Enter text" />
<!-- Layout Components -->
<MainLayout
:menu-items="menuItems"
:app-name="'My App'"
:user-info="userInfo"
>
<div>Your content here</div>
</MainLayout>
</div>
</template>
<script setup>
import { ref } from 'vue'
const text = ref('')
const menuItems = ref([
{ id: 'home', label: 'Home', icon: 'dashboard-icon', href: '/home' },
{ id: 'about', label: 'About', icon: 'info', href: '/about' }
])
const userInfo = ref({
name: 'John Doe',
role: 'Admin',
avatar: 'JD'
})
</script>📚 Component Categories
🎯 Basic Components (10)
TheLoader- Loading spinnerDaColorChip- Color display chipDaError- Error message displayDaMessage- Message componentDaTabs- Tab navigationDaChips- Chip componentsDaButton- Button componentDaModal- Modal dialogDaImg- Image component with iconsDaCheckbox- Checkbox input
📝 Form Components (10)
DaTextarea- Textarea inputDaInputNumber- Number inputDaSelectButton- Select button groupDaInputText- Text inputDaDropdown- Dropdown selectDaInputSwitch- Toggle switchDaPassword- Password inputDaPagination- Pagination controlsDaMultiSelect- Multi-select dropdownDaTreeSelect- Tree select component
📊 Data Components (10)
DaFormModal- Form modalDaDataTable- Data tableDaListboxWithCheckbox- Listbox with checkboxesDaInputNumberWithUnit- Number input with unitDaCalendar- Calendar with time pickerDaPieChart- Pie chartDaBarChart- Bar chartDaLineChart- Line chartDaDropdownPageSize- Page size selectorDaTableSkeleton- Table skeleton loader
🛠️ Utility Components (7)
DaLabel- Label componentDaDotColor- Color dot indicatorDaTriStateCheckBox- Three-state checkboxDaEllipsis- Text ellipsis with tooltipDaInputGroup- Input group wrapperDaInputMask- Input with maskIconHelp- Help icon with popoverRowDetails- Expandable row details
🎨 Advanced Components (1)
DaTieredMenu- Multi-level menu
⚡ Specialized Components (7)
DaPopover- Popover componentErrorWithRefreshButton- Error with refreshActionMenu- Action menuDaDropdownButton- Dropdown buttonDaNavbarItems- Navbar itemsDaTableToolBar- Table toolbarDaTableFilter- Table filterDaTableContent- Table content
🏗️ Layout Components (3)
MainLayout- Main layout wrapperTopbar- Top navigation barSidebar- Sidebar navigation
🎨 Icon Components (11)
BroadcastStationIcon- Broadcast station iconCaretIcon- Caret iconGroupIcon- Group iconNotificationIcon- Notification iconPeopleCommunityIcon- People community iconPersonIcon- Person iconRadioDeviceIcon- Radio device iconRadioUnitIcon- Radio unit iconStopIcon- Stop iconTalkgroupIcon- Talkgroup iconTrashBinIcon- Trash bin icon
🔔 Toast Components (1)
ToastMessage- Toast notification
🎯 Misc Components (2)
DaPopover- Popover componentErrorWithRefreshButton- Error with refresh button
🎨 Customization
MainLayout Customization
<template>
<MainLayout
:menu-items="customMenuItems"
:app-name="'My Custom App'"
:app-subtitle="'Dashboard'"
:user-info="customUserInfo"
:version="'2.0.0'"
:copyright="'© 2024 My Company'"
:default-expanded="true"
:backgroundColor="'#f8f9fa'"
:contentPadding="'20px'"
@menu-click="handleMenuClick"
@logo-click="handleLogoClick"
>
<div>Your content</div>
</MainLayout>
</template>
<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
const customMenuItems = ref([
{
id: 'dashboard',
label: 'Dashboard',
icon: 'dashboard-icon',
href: '/dashboard' // or to: '/dashboard' for Vue Router
},
{
id: 'users',
label: 'Users',
icon: 'reports-icon',
href: '/users'
}
])
const customUserInfo = ref({
name: 'Alice Johnson',
role: 'Product Manager',
avatar: 'AJ'
})
const handleMenuClick = (item) => {
if (item.href) {
window.location.href = item.href // External link
} else if (item.to) {
router.push(item.to) // Vue Router
}
}
const handleLogoClick = () => {
router.push('/') // Navigate to home
}
</script>Chart Components
<template>
<div>
<!-- Pie Chart -->
<DaPieChart :option="pieChartOption" />
<!-- Bar Chart -->
<DaBarChart :option="barChartOption" />
<!-- Line Chart -->
<DaLineChart
:series="lineChartSeries"
:x-axis="lineChartXAxis"
:option="lineChartOption"
/>
</div>
</template>
<script setup>
const pieChartOption = ref({
series: [{
type: 'pie',
data: [
{ value: 335, name: 'Direct' },
{ value: 310, name: 'Email' },
{ value: 234, name: 'Affiliate' }
]
}]
})
const barChartOption = ref({
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri']
},
yAxis: { type: 'value' },
series: [{
type: 'bar',
data: [120, 200, 150, 80, 70]
}]
})
const lineChartSeries = ref([{
name: 'Series 1',
type: 'line',
data: [120, 132, 101, 134, 90, 230, 210]
}])
const lineChartXAxis = ref(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'])
</script>Toast Messages
<template>
<div>
<ToastMessage />
<button @click="showToast">Show Toast</button>
</div>
</template>
<script setup>
const showToast = () => {
if (window.triggerToast) {
window.triggerToast({
severity: 'success',
detail: 'Operation completed successfully!',
life: 3000,
closable: true,
position: 'top'
})
}
}
</script>🎨 Styling
The library uses SCSS modules for styling. You can override styles by:
- CSS Variables: Override CSS custom properties
- SCSS Variables: Import and override SCSS variables
- Component Classes: Use component-specific classes
// Override main layout background
.main-layout {
--background-color: #ffffff;
}
// Override button styles
.da-button {
--button-primary-color: #007bff;
--button-border-radius: 8px;
}🔧 Configuration
Vue Router Integration
// router/index.ts
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', component: Home },
{ path: '/dashboard', component: Dashboard },
{ path: '/users', component: Users }
]
})
export default routerEvent Handling
<template>
<div>
<!-- Error with refresh -->
<ErrorWithRefreshButton
error-message="Something went wrong"
@refresh="handleRefresh"
/>
<!-- Popover -->
<DaPopover hover arrow placement="top">
<DaButton label="Hover me" />
<template #content>
<div>Popover content</div>
</template>
</DaPopover>
</div>
</template>
<script setup>
const handleRefresh = () => {
// Retry the failed operation
console.log('Refreshing...')
}
</script>📱 Responsive Design
All components are responsive and work on:
- Desktop (1200px+)
- Tablet (768px - 1199px)
- Mobile (320px - 767px)
🎯 Browser Support
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
📄 License
Copyright (c) 2024 Tait Communications. All rights reserved.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
📞 Support
For support and questions:
- Create an issue on GitHub
- Contact: [email protected]
Total Components: 62 Categories: 9 Built with: Vue 3, TypeScript, PrimeVue, SCSS
