# @xintao1105/scroll-tabs

> ```bash npm install @xintao1105/scroll-tabs ```

Latest version **1.0.8** (published 2023-09-20) · 0 weekly downloads

## Install

```sh
npm install @xintao1105/scroll-tabs
pnpm add @xintao1105/scroll-tabs
yarn add @xintao1105/scroll-tabs
bun add @xintao1105/scroll-tabs
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2023-09-20 |
| First published | 2023-09-20 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 64.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | zhangxt1105 |
| Keywords | scroll-tabs, scroll, tabs |

## Links

- npm: https://www.npmjs.com/package/@xintao1105/scroll-tabs
- npm.io page: https://npm.io/package/@xintao1105/scroll-tabs

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [@feige0629/debug-console](https://npm.io/package/@feige0629/debug-console.md) ^0.1.3

## Recent versions

- 1.0.8 (latest) — 2023-09-20
- 1.0.7 — 2023-09-20
- 1.0.6 — 2023-09-20
- 1.0.5 — 2023-09-20
- 1.0.4 — 2023-09-20
- 1.0.3 — 2023-09-20
- 1.0.2 — 2023-09-20

## README

!['示例图'](https://cdn.jsdelivr.net/npm/@xintao1105/scroll-tabs@1.0.3/scroll-tabs.gif)

## 安装

```bash
npm install @xintao1105/scroll-tabs
```

or

```bash
yarn add @xintao1105/scroll-tabs
```

## 示例代码

```ts
import ScrollTabs from '@xintao1105/scroll-tabs';
import type { interProps } from '@xintao1105/scroll-tabs';

const ars:interProps = {
    onClick: (e) => { console.log("onClick", e) }
  }

<ScrollTabs {...ars}/>
```

## 参数类型

```ts
interface dataProps {
  s: string | number;
  content: string | number;
}

interface style {
  fontFamily: string;
  fontSize: number;
  color: string;
  fontWeight: string | number;
  letterSpacing: number;
  lineHeight: number;
  fontStyle: string;
}

interface offset {
  x: number;
  y: number;
}

export interface fillColor {
  /**
   * 颜色类型 纯色 | 渐变色; 默认纯色
   * @type {String}
   * @default type = "pure"
   */
  type: "pure" | "linear";
  /**
   * 纯色色值
   * @default pure = ""
   */
  pure: string;
  /**
   * 渐变色
   */
  linear: {
    /**
     * 渐变色 色值列表
     * @default stops = []
     */
    stops: {
      offset: number;
      color: string;
    }[];
    /**
     * 渐变角度
     * @default angle = 0
     */
    angle: number;
    /**
     * 渐变透明度
     * @default opacity = 1
     */
    opacity: number;
  };
}

export interface styleProps extends style {
  /**
   * 文本偏移
   * @default offset = {x:0,y:0}
   */
  offset: offset;
  /**
   * 开启文本阴影
   * @default shadow = false
   */
  shadow: boolean;
  /**
   * 文本阴影
   * @default textShadow = {"shadowColor": "#0075ff","shadowOffsetX": 0,"shadowOffsetY": 0,"shadowBlur": 8,"extend": 0}
   */
  textShadow?: {
    shadowColor: string;
    shadowOffsetX: number;
    shadowOffsetY: number;
    shadowBlur: number;
    extend: number;
  };
  /**
   * 文本背景填充类型 默认颜色填充
   * @type {string}
   * @default fillType = "color"
   */
  fillType: "color" | "image";
  /**
   * 文本背景颜色填充 fillType = "color" 时生效 开始色值 | 结束色值 | 角度
   * @default fillColor = {"startVal": "rgba(15,22,34,0.6)","endVal": "rgba(15,22,34,0.6)","direction": 0}
   */
  fillColor: fillColor;
  /**
   * 文本背景图片填充 fillType = "image" 时生效
   * @default fillImage = ""
   */
  fillImage: string;
  /**
   * 文本框描边
   * @default stroke = false
   */
  stroke: boolean;
  /**
   * 文本框描边粗细
   * @default strokeWidth = 2
   */
  strokeWidth: number;
  /**
   * 文本框描边颜色
   * @default strokeColor = "rgba(160,169,184,0.3)"
   */
  strokeColor: string;
}

export interface seriesListProps {
  /**
   * 选项字段值 根据 数据项 字段 s 映射
   */
  fieldValue?: string | number;
  /**
   * 默认样式
   */
  style?: styleProps;
  /**
   * 选中样式
   */
  selectStyle?: styleProps;
}

export interface interProps {
  /**
   * 唯一标识ID 默认使用系统生成的32位uuid
   */
  id?: string;
  /**
   * 宽
   */
  width?: number;
  /**
   * 高
   */
  height?: number;
  /**
   * 从1开始，0即不选中
   * @default initIndex = 1
   */
  initIndex?: number;
  /**
   * 文本溢出
   * @type {string}
   * @default textOverflow = "break-word"
   */
  textOverflow?: "break-word" | "ellipsis";
  /**
   * 排列方向
   * @type {string}
   * @default direction = "row"
   */
  direction?: "row" | "column";
  /**
   * 宽度 当direction = "row"时生效
   * @default directionWidth = 125
   */
  directionWidth?: number;
  /**
   * 高度 当direction = "column"时生效
   * @default directionHeight = 45
   */
  directionHeight?: number;
  /**
   * 选项卡间距
   * @default tabMargin = 4
   */
  tabMargin?: number;
  /**
   * 水平对齐 "flex-start" | "center" | "flex-end";
   * @type {string}
   * @default alignItems = "center"
   */
  alignItems?: "flex-start" | "center" | "flex-end";
  /**
   * 自动轮播
   * @default animate = false
   */
  animate?: boolean;
  /**
   * 间隔时长 当animate = true 时生效；单位s
   * @default interval = 3
   */
  interval?: number;
  /**
   * 点击停留 当animate = true 时生效；单位s
   * @default stay = 10
   */
  stay?: number;
  /**
   * 默认样式
   */
  style?: styleProps;
  /**
   * 选中样式
   */
  selectStyle?: styleProps;
  /**
   * 系列配置
   */
  seriesList?: Array<seriesListProps>;
  /**
   * 数据
   */
  data?: Array<dataProps>;
  /**
   * 点击回调
   */
  readonly onClick?: (e: any) => void;
  /**
   * 状态改变回调
   */
  readonly onChange?: (e: any) => void;
}
```

---
_Source: https://npm.io/package/@xintao1105/scroll-tabs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
