File tree Expand file tree Collapse file tree 8 files changed +51
-20
lines changed Expand file tree Collapse file tree 8 files changed +51
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ ```
Original file line number Diff line number Diff line change 1+ export default function ( ) { }
Original file line number Diff line number Diff line change 1- ## Minimal Usage
2-
31``` tsx
42import React from ' react' ;
53import ' 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```
Original file line number Diff line number Diff line change 1+ export default function ( ) { }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff 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 ] ,
You can’t perform that action at this time.
0 commit comments