Components/Button
VerifiedSince 1.0.0

Button

Tactile button system with flat variants

Button

Usage

Buttons trigger explicit actions. Keep a clear hierarchy in the interface:

  • Keep a single primary button per view to avoid hierarchy conflicts
  • Use variant and size to convey action priority
  • Async actions should show loading to avoid repeated triggers

Variants

Appearance

Base visuals and semantic variants.

Demo loads on client.

Disabled

Disabled states.

Demo loads on client.

Loading

Show loading feedback during async actions.

Demo loads on client.

Sizes

Buttons provide three sizes beyond the default, affecting density and tactile feel.

Demo loads on client.

Block

Block buttons fill the container width for full-width primary actions.

Demo loads on client.

Shapes

Adjust shapes with plain / round / circle / dashed.

Demo loads on client.

Haptics

Haptic feedback for mobile interactions, with multiple intensity options.

Demo loads on client.

API Specifications

Button Attributes

ParameterTypeDefaultDescription
variant
primary
secondary
ghost
danger
success
warning
info
flat
bare
-

Visual variant

type
primary
success
warning
danger
info
text
-

Shortcut semantic type (legacy)

size
sm
md
lg
large
small
mini
'md'

Button size

block
boolean
false

Block-level (full width)

plain
boolean
false

Plain style

dashed
boolean
false

Dashed style

round
boolean
false

Rounded style

circle
boolean
false

Circular button

loading
boolean
false

Loading state

disabled
boolean
false

Disabled state

icon
string
-

Icon class name

autofocus
boolean
false

Autofocus

native-type
button
submit
reset
'button'

Native type attribute

vibrate
boolean
true

Enable haptics

vibrate-type
light
medium
heavy
bit
success
warning
error
'light'

Haptic type

Parameter
variant
Type
primary
secondary
ghost
danger
success
warning
info
flat
bare
Default
-
Description

Visual variant

Parameter
type
Type
primary
success
warning
danger
info
text
Default
-
Description

Shortcut semantic type (legacy)

Parameter
size
Type
sm
md
lg
large
small
mini
Default
'md'
Description

Button size

Parameter
block
Type
boolean
Default
false
Description

Block-level (full width)

Parameter
plain
Type
boolean
Default
false
Description

Plain style

Parameter
dashed
Type
boolean
Default
false
Description

Dashed style

Parameter
round
Type
boolean
Default
false
Description

Rounded style

Parameter
circle
Type
boolean
Default
false
Description

Circular button

Parameter
loading
Type
boolean
Default
false
Description

Loading state

Parameter
disabled
Type
boolean
Default
false
Description

Disabled state

Parameter
icon
Type
string
Default
-
Description

Icon class name

Parameter
autofocus
Type
boolean
Default
false
Description

Autofocus

Parameter
native-type
Type
button
submit
reset
Default
'button'
Description

Native type attribute

Parameter
vibrate
Type
boolean
Default
true
Description

Enable haptics

Parameter
vibrate-type
Type
light
medium
heavy
bit
success
warning
error
Default
'light'
Description

Haptic type

Button Events

ParameterTypeDefaultDescription
click
(event: MouseEvent) => void
-

Triggered on click

Parameter
click
Type
(event: MouseEvent) => void
Default
-
Description

Triggered on click

Types

EXAMPLE.TS
import type { TxButtonProps } from '@talex-touch/tuffex'

export interface ButtonProps extends TxButtonProps {}

Composition Notes

Split Button

A combined button for "primary action + more actions" (e.g., RUN + …).

Demo loads on client.

Primary + Ghost

Pair primary with ghost for clear hierarchy.

Demo loads on client.

Design Principles

  • Keep a single primary button to avoid hierarchy conflicts.
  • Keep variant consistent within similar actions.
  • Async actions must use loading to avoid duplicate triggers.
  • Prefer vibrate on mobile to enhance tactile feedback.

Design Notes

  • Emphasize press feedback with smooth rebound.
  • Translucent surfaces need proper background contrast.
  • Keep icon/text spacing consistent to avoid visual drift.

Source

View source
packages/tuffex/packages/components/src/button/index.ts
Was this helpful?