mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
docs(react): update component usage docs (#17615)
This commit is contained in:
@ -36,6 +36,39 @@ If the FAB button is not wrapped with `<ion-fab>`, it will scroll with the conte
|
||||
```
|
||||
|
||||
|
||||
### React
|
||||
|
||||
```tsx
|
||||
import React from 'react';
|
||||
|
||||
import { IonContent, IonFab, IonFabButton } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<IonContent>
|
||||
|
||||
{/*-- Fixed Floating Action Button that does not scroll with the content --*/}
|
||||
<IonFab>
|
||||
<IonFabButton>Button</IonFabButton>
|
||||
</IonFab>
|
||||
|
||||
{/*-- Default Floating Action Button that scrolls with the content.--*/}
|
||||
<IonFabButton>Default</IonFabButton>
|
||||
|
||||
{/*-- Mini --*/}
|
||||
<IonFabButton size="small">Mini</IonFabButton>
|
||||
|
||||
{/*-- Colors --*/}
|
||||
<IonFabButton color="primary">Primary</IonFabButton>
|
||||
<IonFabButton color="secondary">Secondary</IonFabButton>
|
||||
<IonFabButton color="danger">Danger</IonFabButton>
|
||||
<IonFabButton color="light">Light</IonFabButton>
|
||||
<IonFabButton color="dark">Dark</IonFabButton>
|
||||
</IonContent>
|
||||
);
|
||||
|
||||
export default Example
|
||||
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
|
29
core/src/components/fab-button/usage/react.md
Normal file
29
core/src/components/fab-button/usage/react.md
Normal file
@ -0,0 +1,29 @@
|
||||
```tsx
|
||||
import React from 'react';
|
||||
|
||||
import { IonContent, IonFab, IonFabButton } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<IonContent>
|
||||
|
||||
{/*-- Fixed Floating Action Button that does not scroll with the content --*/}
|
||||
<IonFab>
|
||||
<IonFabButton>Button</IonFabButton>
|
||||
</IonFab>
|
||||
|
||||
{/*-- Default Floating Action Button that scrolls with the content.--*/}
|
||||
<IonFabButton>Default</IonFabButton>
|
||||
|
||||
{/*-- Mini --*/}
|
||||
<IonFabButton size="small">Mini</IonFabButton>
|
||||
|
||||
{/*-- Colors --*/}
|
||||
<IonFabButton color="primary">Primary</IonFabButton>
|
||||
<IonFabButton color="secondary">Secondary</IonFabButton>
|
||||
<IonFabButton color="danger">Danger</IonFabButton>
|
||||
<IonFabButton color="light">Light</IonFabButton>
|
||||
<IonFabButton color="dark">Dark</IonFabButton>
|
||||
</IonContent>
|
||||
);
|
||||
|
||||
export default Example
|
Reference in New Issue
Block a user