Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/afeiship/react-tabs

Tabs component for react.
https://github.com/afeiship/react-tabs

react tab tabs

Last synced: 22 days ago
JSON representation

Tabs component for react.

Awesome Lists containing this project

README

        

# react-tabs
> Tabs component for react.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
npm install -S @jswork/react-tabs
```

## properties
| Name | Type | Required | Default | Description |
| ------------ | ------- | -------- | ----------- | ------------------------------------- |
| className | string | false | - | The extended className for component. |
| defaultValue | string | false | - | The default value. |
| value | string | false | - | The runtime value. |
| trigger | array | false | ['onClick'] | The trigger event. |
| extra | element | false | - | The extra element. |
| onChange | func | false | noop | The change handler. |

## usage
1. import css
```scss
@import "~@jswork/react-tabs/dist/style.css";

// or use sass
@import "~@jswork/react-tabs/dist/style.scss";

// customize your styles:
$react-tabs-options: ()
```
2. import js
```js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import { Tabs, Tab } from '@jswork/react-tabs';
import './assets/style.scss';

class App extends React.Component {
render() {
return (

{
console.log('runtime value:', e.target.value);
}}>

Tab content1


Tab content2


Tab content3

{
console.log('runtime value:', e.target.value);
}}>

Tab content1


Tab content2


Tab content3



);
}
}

ReactDOM.render(, document.getElementById('app'));

```

## documentation
- https://afeiship.github.io/react-tabs/

## license
Code released under [the MIT license](https://github.com/afeiship/react-tabs/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/react-tabs
[version-url]: https://npmjs.org/package/@jswork/react-tabs

[license-image]: https://img.shields.io/npm/l/@jswork/react-tabs
[license-url]: https://github.com/afeiship/react-tabs/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-tabs
[size-url]: https://github.com/afeiship/react-tabs/blob/master/dist/react-tabs.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/react-tabs
[download-url]: https://www.npmjs.com/package/@jswork/react-tabs