Skip to content

Commit 6f23387

Browse files
adding responsive and minimal-usage
examples
1 parent 20050ab commit 6f23387

File tree

8 files changed

+51
-20
lines changed

8 files changed

+51
-20
lines changed

example/stories/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
```tsx
2+
import React from 'react';
3+
import 'react-dyn-tabs/style/react-dyn-tabs.css';
4+
import 'react-dyn-tabs/themes/react-dyn-tabs-card.css';
5+
import useDynTabs from 'react-dyn-tabs';
6+
7+
const initialOptions = {
8+
tabs: [
9+
{
10+
id: '1',
11+
title: 'tab 1',
12+
panelComponent: (porps) => <p> panel 1 </p>,
13+
},
14+
{
15+
id: '2',
16+
title: 'tab 2',
17+
panelComponent: (porps) => <p> panel 2 </p>,
18+
},
19+
],
20+
selectedTabID: '1',
21+
};
22+
23+
function App() {
24+
const [TabList, PanelList] = useDynTabs(initialOptions);
25+
return (
26+
<div>
27+
<TabList></TabList>
28+
<PanelList></PanelList>
29+
</div>
30+
);
31+
}
32+
<App />;
33+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default function () {}

example/stories/tabs/Readme.md renamed to example/stories/responsive/README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
## Minimal Usage
2-
31
```tsx
42
import React from 'react';
53
import 'react-dyn-tabs/style/react-dyn-tabs.css';
@@ -47,5 +45,18 @@ function App() {
4745
</div>
4846
);
4947
}
50-
<App />;
48+
function App2() {
49+
const [TabList, PanelList] = useDynTabs(initialOptions);
50+
return (
51+
<div>
52+
<TabList></TabList>
53+
<PanelList></PanelList>
54+
</div>
55+
);
56+
}
57+
58+
<>
59+
<App />
60+
<App2 />
61+
</>;
5162
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default function () {}

example/stories/tabs/Tabs.comp.jsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

example/stories/tabs/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

styleguide.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module.exports = {
1515
sections: [
1616
{
1717
name: 'Examples',
18-
content: 'example/stories/tabs/Readme.md',
19-
components: 'example/stories/**/*.comp.jsx',
18+
content: 'example/stories/minimal-usage/README.md',
19+
components: 'example/stories/**/*.jsx',
2020
sectionDepth: 1,
2121
},
2222
],

0 commit comments

Comments
 (0)