-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathTabsBasic.tsx
More file actions
37 lines (32 loc) · 1.02 KB
/
TabsBasic.tsx
File metadata and controls
37 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import { IonLabel, IonTabBar, IonTabButton, IonTabs, IonTab, IonPage } from '@ionic/react';
interface TabsProps {}
const TabsBasic: React.FC<TabsProps> = () => {
const onTabWillChange = (event: CustomEvent) => {
console.log('onIonTabsWillChange', event.detail.tab);
};
const onTabDidChange = (event: CustomEvent) => {
console.log('onIonTabsDidChange:', event.detail.tab);
};
return (
<IonPage>
<IonTabs onIonTabsWillChange={onTabWillChange} onIonTabsDidChange={onTabDidChange}>
<IonTab tab="tab1">
<IonLabel>Tab 1 Content</IonLabel>
</IonTab>
<IonTab tab="tab2">
<IonLabel>Tab 2 Content</IonLabel>
</IonTab>
<IonTabBar slot="bottom">
<IonTabButton tab="tab1">
<IonLabel>Tab 1</IonLabel>
</IonTabButton>
<IonTabButton tab="tab2">
<IonLabel>Tab 2</IonLabel>
</IonTabButton>
</IonTabBar>
</IonTabs>
</IonPage>
);
};
export default TabsBasic;