Components/Installation

Installation

Install Tuffex and import it per component, per suite, or from the root entry.

Since 0.4.0BETA

This component doc is in progress

This page is still being migrated. Demos and API details may change.

Installation

Vue 3 is a peer dependency.

EXAMPLE.BASH
pnpm add @talex-touch/tuffex

Usage

All three give you the same components; they differ only in bundle size.

StyleImport pathUse for
Per component@talex-touch/tuffex/buttonNew code; bundles only what you use
Per suite@talex-touch/tuffex/basePages that use one suite heavily
Root entry@talex-touch/tuffexMigration only; pulls in the whole library
EXAMPLE.TYPESCRIPT
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.

EXAMPLE.TYPESCRIPT
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.

EXAMPLE.TYPESCRIPT
import { TxTimeseriesChart } from '@talex-touch/tuffex/charts'
import '@talex-touch/tuffex/charts/style.css'

Root Entry (Migration)

EXAMPLE.TYPESCRIPT
import TuffUI from '@talex-touch/tuffex'
import '@talex-touch/tuffex/style.css'

app.use(TuffUI)

Styles

Styles are not injected by JavaScript.

StylesheetContentsRequired
@talex-touch/tuffex/base.css--tx-* variables, reset, theme selectorsYes, once per app
@talex-touch/tuffex/<name>/style.cssOne component's stylesFor each component you use
@talex-touch/tuffex/style.cssAll component stylesRoot entry only

To override tokens, see Theming.

Utils

EXAMPLE.TYPESCRIPT
import { nextZIndex, toast } from '@talex-touch/tuffex/utils'

Full API in Utils.

Technologies

  • Entry map: exports in packages/tuffex/package.json.
  • Suite entries: packages/tuffex/packages/components/src/{base,pro,ai}/index.ts; suite-barrels.test.ts checks that together they partition every component exactly.