mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
docs(react): update component usage docs (#17615)
This commit is contained in:
@ -163,6 +163,45 @@ Using tabs with Angular's router is fairly straight forward. Here you only need
|
||||
```
|
||||
|
||||
|
||||
### React
|
||||
|
||||
```tsx
|
||||
import React from 'react';
|
||||
|
||||
import { IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel, IonBadge } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
|
||||
<IonTabs>
|
||||
<IonTabBar slot="bottom">
|
||||
<IonTabButton tab="schedule">
|
||||
<IonIcon name="calendar" />
|
||||
<IonLabel>Schedule</IonLabel>
|
||||
<IonBadge>6</IonBadge>
|
||||
</IonTabButton>
|
||||
|
||||
<IonTabButton tab="speakers">
|
||||
<IonIcon name="contacts" />
|
||||
<IonLabel>Speakers</IonLabel>
|
||||
</IonTabButton>
|
||||
|
||||
<IonTabButton tab="map">
|
||||
<IonIcon name="map" />
|
||||
<IonLabel>Map</IonLabel>
|
||||
</IonTabButton>
|
||||
|
||||
<IonTabButton tab="about">
|
||||
<IonIcon name="information-circle" />
|
||||
<IonLabel>About</IonLabel>
|
||||
</IonTabButton>
|
||||
</IonTabBar>
|
||||
</IonTabs>
|
||||
);
|
||||
|
||||
export default Example;
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
|
||||
35
core/src/components/tabs/usage/react.md
Normal file
35
core/src/components/tabs/usage/react.md
Normal file
@ -0,0 +1,35 @@
|
||||
```tsx
|
||||
import React from 'react';
|
||||
|
||||
import { IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel, IonBadge } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
|
||||
<IonTabs>
|
||||
<IonTabBar slot="bottom">
|
||||
<IonTabButton tab="schedule">
|
||||
<IonIcon name="calendar" />
|
||||
<IonLabel>Schedule</IonLabel>
|
||||
<IonBadge>6</IonBadge>
|
||||
</IonTabButton>
|
||||
|
||||
<IonTabButton tab="speakers">
|
||||
<IonIcon name="contacts" />
|
||||
<IonLabel>Speakers</IonLabel>
|
||||
</IonTabButton>
|
||||
|
||||
<IonTabButton tab="map">
|
||||
<IonIcon name="map" />
|
||||
<IonLabel>Map</IonLabel>
|
||||
</IonTabButton>
|
||||
|
||||
<IonTabButton tab="about">
|
||||
<IonIcon name="information-circle" />
|
||||
<IonLabel>About</IonLabel>
|
||||
</IonTabButton>
|
||||
</IonTabBar>
|
||||
</IonTabs>
|
||||
);
|
||||
|
||||
export default Example;
|
||||
```
|
||||
Reference in New Issue
Block a user