Installation
Install Tuffex and import it per component, per suite, or from the root entry.
Installation
Vue 3 is a peer dependency.
pnpm add @talex-touch/tuffex
Usage
All three give you the same components; they differ only in bundle size.
| Style | Import path | Use for |
|---|---|---|
| Per component | @talex-touch/tuffex/button | New code; bundles only what you use |
| Per suite | @talex-touch/tuffex/base | Pages that use one suite heavily |
| Root entry | @talex-touch/tuffex | Migration only; pulls in the whole library |
Per Component (Recommended)
import TxButton from '@talex-touch/tuffex/button'
import TxSwitch from '@talex-touch/tuffex/switch'
import '@talex-touch/tuffex/base.css'
import '@talex-touch/tuffex/button/style.css'
import '@talex-touch/tuffex/switch/style.css'
app.use(TxButton)
app.use(TxSwitch)
Per Suite
The base, pro, and ai entries don't overlap; each component belongs to exactly one. Suite entries export named components only, and styles are imported per component.
import { TxButton, TuffSwitch } from '@talex-touch/tuffex/base'
import '@talex-touch/tuffex/base.css'
import '@talex-touch/tuffex/button/style.css'
import '@talex-touch/tuffex/switch/style.css'
app.use(TxButton)
app.use(TuffSwitch)
Data and Motion suite components import from pro; the chart family also has its own @talex-touch/tuffex/charts entry.
import { TxTimeseriesChart } from '@talex-touch/tuffex/charts'
import '@talex-touch/tuffex/charts/style.css'
Root Entry (Migration)
import TuffUI from '@talex-touch/tuffex'
import '@talex-touch/tuffex/style.css'
app.use(TuffUI)
Styles
Styles are not injected by JavaScript.
| Stylesheet | Contents | Required |
|---|---|---|
@talex-touch/tuffex/base.css | --tx-* variables, reset, theme selectors | Yes, once per app |
@talex-touch/tuffex/<name>/style.css | One component's styles | For each component you use |
@talex-touch/tuffex/style.css | All component styles | Root entry only |
To override tokens, see Theming.
Utils
import { nextZIndex, toast } from '@talex-touch/tuffex/utils'
Full API in Utils.
Technologies
- Entry map:
exportsinpackages/tuffex/package.json. - Suite entries:
packages/tuffex/packages/components/src/{base,pro,ai}/index.ts;suite-barrels.test.tschecks that together they partition every component exactly.