test-nut-ui
Version:
<p align="center"> <img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;"> </p>
117 lines (116 loc) • 2.76 kB
TypeScript
import React, { FunctionComponent } from 'react';
import { BasicComponent } from '../../utils/typings';
import TabPane from '../../packages/tabpane';
import '@nascent/nutui-icons-react/lib/style.css';
export type TabsTitle = {
title: string;
disabled: boolean;
active?: boolean;
value: string | number;
};
export interface TabsProps extends BasicComponent {
/**
* 标签栏样式
* @default {}
*/
tabStyle: React.CSSProperties
/**
* 当前激活 tab 面板的值
* @default 0
*/
value: string | number
/**
* 初始化激活 tab 的值
* @default 0
*/
defaultValue: string | number
/**
* 标签选中色
* @default #1a1a1a
*/
activeColor: string
/**
* 使用横纵方向
* @default horizontal
*/
direction: 'horizontal' | 'vertical'
/**
* 选项卡样式类型 (默认样式、标签样式、滑块样式、分段器样式、单选按钮)
* @default normal
*/
type: 'normal' | 'tag' | 'slider' | 'card' | 'radio'
/**
* type 为 slider 滑块的位置
* @default normal
*/
sliderMode: 'normal' | 'middle'
/**
* 是否开启吸顶
* @default false
*/
isSticky: boolean
/**
* 开启吸顶后距离顶部的位置
* @default 0
*/
stickyThreshold: number
/**
* 选中底部展示样式 可选值 line、smile
* @default line
*/
activeType: 'line' | 'smile'
/**
* direction 为 horizontal 是下划线的类型
* @default normal
*/
underlineType: 'normal' | 'adaptive' | 'full'
/**
* 切换动画时长,单位 ms 0 代表无动画
* @default 300
*/
duration: number | string
/**
* 标题左对齐
* @default -
*/
align: 'left' | 'right'
/**
* 分割方式
* @default none
*/
dividerType: 'none' | 'shadow' | 'line'
/**
* 选项超出屏幕宽度后,是否使用下拉模式
* @default false
*/
menu: boolean
/**
* 自定义导航区域
* @default -
*/
title: () => JSX.Element[]
/**
* 自定义下划线样式
* @default -
*/
line: () => JSX.Element
/**
* 当前激活的标签改变时触发
* @default -
*/
onChange: (index: string | number) => void
/**
* 点击标签时触发
* @default -
*/
onClick: (index: string | number) => void
/**
* 自动高度。设置为 true 时,nut-tabs 和 nut-tabs\_\_content 会随着当前 nut-tabpane 的高度而发生变化。
* @default false
*/
autoHeight: boolean
children?: React.ReactNode;
}
export declare const Tabs: FunctionComponent<Partial<TabsProps>> & {
TabPane: typeof TabPane;
};