mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
docs(react): updating icon usages
This commit is contained in:
@ -97,6 +97,7 @@ This attribute specifies the size of the button. Setting this attribute will cha
|
||||
import React from 'react';
|
||||
|
||||
import { IonButton, IonIcon, IonContent } from '@ionic/react';
|
||||
import { star } from 'ionicons/icons';
|
||||
|
||||
export const ButtonExample: React.FC = () => (
|
||||
<IonContent>
|
||||
@ -131,17 +132,17 @@ export const ButtonExample: React.FC = () => (
|
||||
|
||||
{/*-- Icons --*/}
|
||||
<IonButton>
|
||||
<IonIcon slot="start" name="star" />
|
||||
<IonIcon slot="start" icon={star} />
|
||||
Left Icon
|
||||
</IonButton>
|
||||
|
||||
<IonButton>
|
||||
Right Icon
|
||||
<IonIcon slot="end" name="star" />
|
||||
<IonIcon slot="end" icon={star} />
|
||||
</IonButton>
|
||||
|
||||
<IonButton>
|
||||
<IonIcon slot="icon-only" name="star" />
|
||||
<IonIcon slot="icon-only" icon={star} />
|
||||
</IonButton>
|
||||
|
||||
{/*-- Sizes --*/}
|
||||
|
@ -2,6 +2,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import { IonButton, IonIcon, IonContent } from '@ionic/react';
|
||||
import { star } from 'ionicons/icons';
|
||||
|
||||
export const ButtonExample: React.FC = () => (
|
||||
<IonContent>
|
||||
@ -36,17 +37,17 @@ export const ButtonExample: React.FC = () => (
|
||||
|
||||
{/*-- Icons --*/}
|
||||
<IonButton>
|
||||
<IonIcon slot="start" name="star" />
|
||||
<IonIcon slot="start" icon={star} />
|
||||
Left Icon
|
||||
</IonButton>
|
||||
|
||||
<IonButton>
|
||||
Right Icon
|
||||
<IonIcon slot="end" name="star" />
|
||||
<IonIcon slot="end" icon={star} />
|
||||
</IonButton>
|
||||
|
||||
<IonButton>
|
||||
<IonIcon slot="icon-only" name="star" />
|
||||
<IonIcon slot="icon-only" icon={star} />
|
||||
</IonButton>
|
||||
|
||||
{/*-- Sizes --*/}
|
||||
|
Reference in New Issue
Block a user