Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 바이트디그리
- typescript
- 프로그래밍기초
- next.js 빌드 오류
- ionic react
- javascript
- 프로그래밍첫걸음시작하기
- spartacodingclub
- CSS
- 프로그래머스
- 알고리즘
- PYTHON
- ionic-react
- K디지털크레딧
- 항해99
- 패스트캠퍼스
- ionic
- styled components
- 내일배움카드
- 부트캠프
- react-native
- React Native
- 스파르타코딩클럽 후기
- styled-components
- Firebase
- react
- 스파르타코딩클럽
- HTML
- Algorithm
- mongodb
Archives
- Today
- Total
bravo my life!
[Ionic-React] input UI 구현하기 본문
728x90
1. 개요
ionic-react로 inputUI를 만들어 보았다.
2. 코드 상세
<IonContent className="ion-padding">
<IonItem>
<IonInput
placeholder="with placeholder, without label"
onIonChange={(e) => setText(e.detail.value!)}
></IonInput>
</IonItem>
<IonItem>
<IonInput
type="number"
value={number}
placeholder="Enter Number"
onIonChange={(e) => setNumber(parseInt(e.detail.value!, 10))}
></IonInput>
</IonItem>
<IonItem>
<IonInput placeholder="disabled input" value={text} disabled></IonInput>
</IonItem>
<IonItem>
<IonLabel position="stacked">clear Input</IonLabel>
<IonInput onIonChange={(e: any) => setInput(e.target.value)} clearInput />
</IonItem>
<IonItem>
<IonLabel position="stacked">stacked label</IonLabel>
<IonInput onIonChange={(e: any) => setInput(e.target.value)} />
</IonItem>
<IonItem>
<IonLabel position="floating">Floating Label</IonLabel>
<IonInput value={text}></IonInput>
</IonItem>
<IonItem>
<IonLabel position="fixed">Fixed Label</IonLabel>
<IonInput value={text}></IonInput>
</IonItem>
</IonContent>
아래는 코드의 결과물이다.
사진으로 표현이 힘든 부분에 대해 상세 설명하겠다.
number타입 input은 input요소안에 숫자 입력시 상하 버튼이 나타나고 1, -1씩 증감할 수 있다.
clear input은 input요소안에 내용을 입력한다면 x버튼이 나타나 입력내용을 한 번에 삭제할 수가 있다.
floatind label은 input요소 안에 label이 존재하다가, input요소를 클릭한다면 label이 상단으로 이동한다.
'Framework || Library > Ionic-React' 카테고리의 다른 글
[Ionic-React] 로그인 페이지 만들기 (0) | 2022.07.09 |
---|---|
[Ionic-React] Routing 하기 (0) | 2022.07.09 |
[Ionic-React] button UI 구현하기 (0) | 2022.07.08 |
[Ionic-React] slide UI 구현하기 (0) | 2022.07.07 |
[Ionic-React] Array와 map으로 list를 생성하기 (0) | 2022.07.06 |