Skip to content

Commit f00feb7

Browse files
use styleguidist in example folder
1 parent ab4eab2 commit f00feb7

File tree

9 files changed

+10851
-4198
lines changed

9 files changed

+10851
-4198
lines changed

example/stories/Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
These components are custom components built specifically for Romaak.

example/stories/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as Tabs } from "./tabs/Tabs.comp";
2+
export * from "./tabs";

example/stories/tabs/Readme.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Minimal Usage
2+
3+
```tsx
4+
import React from 'react';
5+
import 'react-dyn-tabs/style/react-dyn-tabs.css';
6+
import 'react-dyn-tabs/themes/react-dyn-tabs-card.css';
7+
import useDynTabs from 'react-dyn-tabs';
8+
import MoreButtonPlugin from 'react-dyn-tabs/plugins/moreButtonPlugin';
9+
10+
const initialOptions = {
11+
tabs: [
12+
{
13+
id: '1',
14+
title: 'tab 1',
15+
panelComponent: (porps) => <p> panel 1 </p>,
16+
},
17+
{
18+
id: '2',
19+
title: 'tab 2',
20+
panelComponent: (porps) => <p> panel 2 </p>,
21+
},
22+
{
23+
id: '3',
24+
title: 'tab 3',
25+
panelComponent: (porps) => <p> panel 3 </p>,
26+
},
27+
{
28+
id: '4',
29+
title: 'tab 4',
30+
panelComponent: (porps) => <p> panel 4 </p>,
31+
},
32+
{
33+
id: '5',
34+
title: 'tab 5',
35+
panelComponent: (porps) => <p> panel 5 </p>,
36+
},
37+
],
38+
selectedTabID: '2',
39+
};
40+
41+
function App() {
42+
const [TabList, PanelList] = useDynTabs(initialOptions, [MoreButtonPlugin]);
43+
return (
44+
<div>
45+
<TabList></TabList>
46+
<PanelList></PanelList>
47+
</div>
48+
);
49+
}
50+
<App />;
51+
```

example/stories/tabs/Tabs.comp.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import '../../../style/react-dyn-tabs.min.css';
3+
import '../../../themes/react-dyn-tabs-card.min.css';
4+
import useDynTabs from '../../../src/index';
5+
import _MoreButtonPlugin from '../../../src/plugins/moreButtonPlugin/index';
6+
7+
export const MoreButtonPlugin = _MoreButtonPlugin;
8+
9+
export default useDynTabs;

example/stories/tabs/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export { default } from "./Tabs.comp";
2+
export * from "./Tabs.comp";
3+
4+

0 commit comments

Comments
 (0)