Titian Design Mobile Vue

website·Indexed 36 days ago

https://titian.design.weimob.com

A mobile UI component library for Vue, provided via the @titian-design/mobile-vue package. It includes a comprehensive set of components across categories such as navigation (Navbar, Tabbar, Sidebar), form inputs (Input, Picker, DateTimePicker, Uploader), feedback (Dialog, Toast, Popup, ActionSheet), and business-specific elements (Price, Sku Selector, Virtual List).

Tokens
204.8K
Snippets
1.3K
Records
1.4K
Agent score
54%

What's inside Titian Design

  1. Use the ti-tag component for marking and selection

    The ti-tag component is used to create labels for marking or selection. It supports different visual variants (contained, filled, outlined), sizes, and shapes, including a specific 'coupon' mode.
    <!-- Basic variants -->
    <ti-tag variant="contained">Contained Tag</ti-tag>
    <ti-tag variant="filled">Filled Tag (Secondary Color)</ti-tag>
    <ti-tag variant="outlined">Outlined Tag</ti-tag>
    
    <!-- Sizes -->
    <ti-tag size="small">Small</ti-tag>
    <ti-tag size="medium">Medium</ti-tag>
    <ti-tag size="big">Big</ti-tag>
    
    <!-- With Icons -->
    <ti-tag left-icon="home" right-icon="arrow-right">Icons Left and Right</ti-tag>
    
    <!-- Coupon Shape -->
    <ti-tag shape="coupon" variant="contained">Coupon Style Tag</ti-tag>
  2. Handle Calendar selection errors with CalErrorProps

    When the error event is triggered, the CalErrorProps object provides details about why the selection failed, such as exceeding the maximum allowed range or selecting a disabled date.
    interface CalErrorProps {
      message: string; // Error message
      type: 'maxSize' | 'maxRange' | 'disabled'; // Error category
    }
  3. Use the ti-input component for single-line text input

    The ti-input component is used for keyboard-based single-line text entry. It supports various input types, validation states, and layout options including labels and icons.
    <ti-input label="Username" placeholder="Please enter your name"></ti-input>
  4. Handle SwipeCell events

    The component emits events when the cell is opened, closed, or clicked. The bind:click event provides information about where the click occurred (e.g., 'left', 'right', 'cell', or 'outside').
    <ti-swipe-cell 
      bind:open="handleOpen" 
      bind:close="handleClose" 
      bind:click="handleSwipeCellClick">
      <view>Event Listener Mode</view>
      <view slot="left">Left</view>
      <view slot="right">Right</view>
    </ti-swipe-cell>
  5. Understand the Titian color system and HSB model

    The Titian design system utilizes the HSB (Hue, Saturation, Brightness) color model to define its color palette. The system is categorized into four main types: Common Palettes, Theme Colors, Neutral Colors, and Functional Colors. When customizing colors, developers and designers should balance aesthetics, recognition, readability, and usability.