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:
52
core/src/components/input/usage/react.md
Normal file
52
core/src/components/input/usage/react.md
Normal file
@@ -0,0 +1,52 @@
|
||||
```tsx
|
||||
import React from 'react';
|
||||
|
||||
import { IonInput, IonItem, IonLabel } from '@ionic/react';
|
||||
|
||||
const Example: React.SFC<{}> = () => (
|
||||
<>
|
||||
{/*-- Default Input --*/}
|
||||
<IonInput></IonInput>
|
||||
|
||||
{/*-- Input with value --*/}
|
||||
<IonInput value="custom"></IonInput>
|
||||
|
||||
{/*-- Input with placeholder --*/}
|
||||
<IonInput placeholder="Enter Input"></IonInput>
|
||||
|
||||
{/*-- Input with clear button when there is a value --*/}
|
||||
<IonInput clearInput value="clear me"></IonInput>
|
||||
|
||||
{/*-- Number type input --*/}
|
||||
<IonInput type="number" value="333"></IonInput>
|
||||
|
||||
{/*-- Disabled input --*/}
|
||||
<IonInput value="Disabled" disabled></IonInput>
|
||||
|
||||
{/*-- Readonly input --*/}
|
||||
<IonInput value="Readonly" readonly></IonInput>
|
||||
|
||||
{/*-- Inputs with labels --*/}
|
||||
<IonItem>
|
||||
<IonLabel>Default Label</IonLabel>
|
||||
<IonInput></IonInput>
|
||||
</IonItem>
|
||||
|
||||
<IonItem>
|
||||
<IonLabel position="floating">Floating Label</IonLabel>
|
||||
<IonInput></IonInput>
|
||||
</IonItem>
|
||||
|
||||
<IonItem>
|
||||
<IonLabel position="fixed">Fixed Label</IonLabel>
|
||||
<IonInput></IonInput>
|
||||
</IonItem>
|
||||
|
||||
<IonItem>
|
||||
<IonLabel position="stacked">Stacked Label</IonLabel>
|
||||
<IonInput></IonInput>
|
||||
</IonItem>
|
||||
</>
|
||||
);
|
||||
|
||||
export default Example
|
||||
Reference in New Issue
Block a user