mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
docs(react): update component usage docs (#17615)
This commit is contained in:
@@ -30,6 +30,35 @@ It's important to note that ion-header needs to be the one of the three root ele
|
||||
```
|
||||
|
||||
|
||||
### React
|
||||
|
||||
```tsx
|
||||
import React from 'react';
|
||||
|
||||
import { IonHeader, IonContent, IonToolbar, IonButtons, IonBackButton, IonTitle } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<>
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonButtons slot="start">
|
||||
<IonBackButton goBack={() => {}} />
|
||||
</IonButtons>
|
||||
<IonTitle>My Navigation Bar</IonTitle>
|
||||
</IonToolbar>
|
||||
|
||||
<IonToolbar>
|
||||
<IonTitle>Subheader</IonTitle>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
|
||||
<IonContent />
|
||||
</>
|
||||
);
|
||||
|
||||
export default Example
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
|
||||
25
core/src/components/header/usage/react.md
Normal file
25
core/src/components/header/usage/react.md
Normal file
@@ -0,0 +1,25 @@
|
||||
```tsx
|
||||
import React from 'react';
|
||||
|
||||
import { IonHeader, IonContent, IonToolbar, IonButtons, IonBackButton, IonTitle } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<>
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonButtons slot="start">
|
||||
<IonBackButton goBack={() => {}} />
|
||||
</IonButtons>
|
||||
<IonTitle>My Navigation Bar</IonTitle>
|
||||
</IonToolbar>
|
||||
|
||||
<IonToolbar>
|
||||
<IonTitle>Subheader</IonTitle>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
|
||||
<IonContent />
|
||||
</>
|
||||
);
|
||||
|
||||
export default Example
|
||||
Reference in New Issue
Block a user