@treeui/vue
v0.7.0
Published
Vue 3 component package for TreeUI.
Downloads
464
Readme
@treeui/vue
Vue 3 component library with 40+ accessible, themeable components built on design tokens.
Install
pnpm add @treeui/vue
# or
npm install @treeui/vueInstall @treeui/tokens only when you need direct access to the token package or want to use the theme CSS outside the Vue component layer.
Setup
import { createApp } from 'vue'
import TreeUI from '@treeui/vue'
import '@treeui/vue/style.css'
const app = createApp(App)
app.use(TreeUI)
app.mount('#app')If your app uses toasts, mount TToastProvider once near the root before calling useToast().
Or import components individually:
import { TButton, TInput, TModal } from '@treeui/vue'
import '@treeui/vue/style.css'Consumer checklist
- Install
@treeui/vue - Import
@treeui/vue/style.cssonce - Use
app.use(TreeUI)or named imports - Mount
TToastProvideronce near the app root if you useuseToast() - Use
TFormFieldas the wrapper for labels, hints, and errors
Components
Form
TInput · TTextarea · TCheckbox · TCombobox · TFileUpload · TRadio · TRadioGroup · TSelect · TMultiSelect · TNumberInput · TDatePicker · TDateTimePicker · TSwitch · TFormField · TToggleGroup · TMarkdownEditor
Layout
TContainer · TGrid · TStack · TSidebar · TNavMenu · TNavbar / TAppBar · TAccordion · TAccordionItem · TCard · TDivider · TTable · TTabs · TTabList · TTab · TTabPanel · TBreadcrumb · TBreadcrumbItem · TSelectableList · TTreeView · TSteps / TStepper · TPricing · TPricingCard
Display
TBadge · TAlert · TAvatar · TEmptyState · TTag · TTimeline · TSpinner · TProgress · TSkeleton · TStat
Overlay & Interaction
TButton · TModal · TConfirmDialog · TDrawer · TDropdown · TPopover · TTooltip · TContextMenu · TPagination · TToast · TToastProvider
Table composition
TTable stays focused on structured listing. Filters, toolbars, bulk actions, and pagination are intended to be composed around it, with TPagination used separately when needed.
Use #cell-<key> and #header-<key> slots when a column needs derived content or custom markup.
Theming
TreeUI uses CSS custom properties (--tree-*) for all styling. Light theme is applied by default.
Dark mode
Dark mode activates automatically via prefers-color-scheme: dark. To control it explicitly:
<!-- Force dark -->
<html data-tree-theme="dark">
<!-- Force light -->
<html data-tree-theme="light">Programmatic control
// Toggle theme
document.documentElement.setAttribute('data-tree-theme', 'dark')Compatibility aliases
All components are also exported with the Tree prefix (e.g. TreeButton, TreeInput) for backwards compatibility.
Conventions
- Primary docs and examples use the
Tprefix for public exports. Tree<Name>aliases remain available for migration and compatibility.TNavbar/TAppBarandTSteps/TStepperare alias pairs for the same implementations.- Page-level assemblies that are mostly layout stay documented as recipes until they need a dedicated semantic API.
- Overlays such as
TModal,TDrawer, andTPopoversupport controlled open state;TModalworks withv-model:open. TSelectacceptsstringornumbervalues.TBreadcrumbItemacceptshreffor anchors andtofor vue-router projects.TBadgekeeps visual variants and can add semantic meaning withtone.TStatincludes aloadingstate for built-in placeholders.
Semantic aliases in docs
Some docs use familiar product terms as aliases for existing TreeUI patterns. These are documentation aliases only, not extra exports.
Snackbar/Notification->TToastBanner->TAlertCollapsible/Details->TAccordionwithtype="single"andcollapsibleApp bar->TNavbar/TAppBarStepper->TSteps/TStepper
Docs-first patterns
Some repeated app UI intentionally stays documented as composition guidance instead of becoming extra exports:
- Stat groups:
TGrid+TStat - Section headers: heading +
TStack+ optionalTBadgeorTButton - Subpanels:
TCard, especiallyvariant="soft" - Stacked cards:
TCardslots +TTag/TBadge/ actions - Eyebrow text: typography recipe using existing tokens
- Form stacks:
TStack+TGrid+TFormField - Rankings:
TTableorTSelectableList - Action panels:
TAlert+TCard+TButton - Color fields:
TFormField+ nativeinput[type="color"] - Tag inputs:
TFormField+TInput+ removableTTag - Router-backed tabs:
TTabs+ app route state - Charts:
TCard+TStack+ your preferred chart library
TypeScript
Full TypeScript support with exported types:
import type { TreeSize, TreeVariant } from '@treeui/vue'Documentation
See the full component docs and interactive playground at the Storybook site.
License
MIT
