노트 (ion-note)
노트(Note)는 추가 정보를 제공하는 부제목 용도로 주로 쓰는 텍스트 요소예요. 기본적으로 회색으로 스타일링되어 나타나며, 아이템 안에서 메타데이터 텍스트로 사용할 수 있습니다.
출처: 문서
본문
노트는 추가 정보를 제공하는 부제목 용도로 일반적으로 사용되는 텍스트 요소입니다. 기본적으로 회색으로 표시되도록 스타일링되어 있어요. 노트는 아이템 안에서 메타데이터 텍스트로 사용할 수 있습니다.
기본 사용법 (Basic Usage)
JavaScript
<ion-note>Default Note</ion-note>
Angular
src/app/example.component.html
<ion-note>Default Note</ion-note>
src/app/example.component.ts
import { Component } from '@angular/core';
import { IonNote } from '@ionic/angular';
@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonNote],
})
export class ExampleComponent {}
React
import React from 'react';
import { IonNote } from '@ionic/react';
function Example() {
return (
<>
<IonNote>Default Note</IonNote>
</>
);
}
export default Example;
Vue
<template>
<ion-note>Default Note</ion-note>
</template>
<script setup lang="ts">
import { IonNote } from '@ionic/vue';
</script>
아이템 안의 노트 (Item Notes)
JavaScript
<ion-item>
<ion-label>Label</ion-label>
<ion-note slot="end">Note (End)</ion-note>
</ion-item>
<ion-item>
<ion-note slot="start">Note (Start)</ion-note>
<ion-label>Label</ion-label>
</ion-item>
Angular
src/app/example.component.html
<ion-item>
<ion-label>Label</ion-label>
<ion-note slot="end">Note (End)</ion-note>
</ion-item>
<ion-item>
<ion-note slot="start">Note (Start)</ion-note>
<ion-label>Label</ion-label>
</ion-item>
src/app/example.component.ts
import { Component } from '@angular/core';
import { IonItem, IonLabel, IonNote } from '@ionic/angular';
@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonItem, IonLabel, IonNote],
})
export class ExampleComponent {}
React
import React from 'react';
import { IonItem, IonLabel, IonNote } from '@ionic/react';
function Example() {
return (
<>
<IonItem>
<IonLabel>Label</IonLabel>
<IonNote slot="end">Note (End)</IonNote>
</IonItem>
<IonItem>
<IonNote slot="start">Note (Start)</IonNote>
<IonLabel>Label</IonLabel>
</IonItem>
</>
);
}
export default Example;
Vue
<template>
<ion-item>
<ion-label>Label</ion-label>
<ion-note slot="end">Note (End)</ion-note>
</ion-item>
<ion-item>
<ion-note slot="start">Note (Start)</ion-note>
<ion-label>Label</ion-label>
</ion-item>
</template>
<script setup lang="ts">
import { IonItem, IonLabel, IonNote } from '@ionic/vue';
</script>
테마 적용 (Theming)
색상 (Colors)
JavaScript
<ion-note>Default Note</ion-note>
<ion-note color="primary">Primary Note</ion-note>
<ion-note color="secondary">Secondary Note</ion-note>
<ion-note color="tertiary">Tertiary Note</ion-note>
<ion-note color="success">Success Note</ion-note>
<ion-note color="warning">Warning Note</ion-note>
<ion-note color="danger">Danger Note</ion-note>
<ion-note color="light">Light Note</ion-note>
<ion-note color="medium">Medium Note</ion-note>
<ion-note color="dark">Dark Note</ion-note>
Angular
src/app/example.component.html
<ion-note>Default Note</ion-note>
<ion-note color="primary">Primary Note</ion-note>
<ion-note color="secondary">Secondary Note</ion-note>
<ion-note color="tertiary">Tertiary Note</ion-note>
<ion-note color="success">Success Note</ion-note>
<ion-note color="warning">Warning Note</ion-note>
<ion-note color="danger">Danger Note</ion-note>
<ion-note color="light">Light Note</ion-note>
<ion-note color="medium">Medium Note</ion-note>
<ion-note color="dark">Dark Note</ion-note>
src/app/example.component.ts
import { Component } from '@angular/core';
import { IonNote } from '@ionic/angular';
@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonNote],
})
export class ExampleComponent {}
React
import React from 'react';
import { IonNote } from '@ionic/react';
function Example() {
return (
<>
<IonNote>Default Note</IonNote>
<IonNote color="primary">Primary Note</IonNote>
<IonNote color="secondary">Secondary Note</IonNote>
<IonNote color="tertiary">Tertiary Note</IonNote>
<IonNote color="success">Success Note</IonNote>
<IonNote color="warning">Warning Note</IonNote>
<IonNote color="danger">Danger Note</IonNote>
<IonNote color="light">Light Note</IonNote>
<IonNote color="medium">Medium Note</IonNote>
<IonNote color="dark">Dark Note</IonNote>
</>
);
}
export default Example;
Vue
<template>
<ion-note>Default Note</ion-note>
<ion-note color="primary">Primary Note</ion-note>
<ion-note color="secondary">Secondary Note</ion-note>
<ion-note color="tertiary">Tertiary Note</ion-note>
<ion-note color="success">Success Note</ion-note>
<ion-note color="warning">Warning Note</ion-note>
<ion-note color="danger">Danger Note</ion-note>
<ion-note color="light">Light Note</ion-note>
<ion-note color="medium">Medium Note</ion-note>
<ion-note color="dark">Dark Note</ion-note>
</template>
<script setup lang="ts">
import { IonNote } from '@ionic/vue';
</script>
CSS Custom Properties
JavaScript
<style>
ion-note {
--color: #54dc98;
}
</style>
<ion-note>Default Note</ion-note>
Angular
src/app/example.component.html
<ion-note>Default Note</ion-note>
src/app/example.component.css
ion-note {
--color: #54dc98;
}
src/app/example.component.ts
import { Component } from '@angular/core';
import { IonNote } from '@ionic/angular';
@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonNote],
})
export class ExampleComponent {}
React
src/main.css
ion-note {
--color: #54dc98;
}
src/main.tsx
import React from 'react';
import { IonNote } from '@ionic/react';
import './main.css';
function Example() {
return (
<>
<IonNote>Default Note</IonNote>
</>
);
}
export default Example;
Vue
<template>
<ion-note>Default Note</ion-note>
</template>
<script setup lang="ts">
import { IonNote } from '@ionic/vue';
</script>
<style>
ion-note {
--color: #54dc98;
}
</style>
Properties
color
설명: 애플리케이션의 색상 팔레트에서 사용할 색상을 지정합니다. 기본 옵션은 "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", "dark"입니다. 색상에 대한 자세한 내용은 theming 문서를 참고하세요.
속성(Attribute): color
타입(Type): "danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined
기본값(Default): undefined
mode
설명: mode는 어떤 플랫폼 스타일을 사용할지 결정합니다. 이는 virtual property로, 초기화 시 한 번 설정되며 첫 렌더링 후 값을 변경해도 업데이트되지 않습니다.
속성(Attribute): mode
타입(Type): "ios" | "md"
기본값(Default): undefined
Events
이 컴포넌트에서 사용할 수 있는 이벤트가 없습니다.
Methods
이 컴포넌트에서 사용할 수 있는 공개 메서드가 없습니다.
CSS Shadow Parts
이 컴포넌트에서 사용할 수 있는 CSS shadow part가 없습니다.
CSS Custom Properties
iOS
| 이름(Name) | 설명(Description) |
|---|---|
--color |
노트의 색상 |
MD
| 이름(Name) | 설명(Description) |
|---|---|
--color |
노트의 색상 |
Slots
| 이름(Name) | 설명(Description) |
|---|---|
| 기본 슬롯입니다. |
더 알아보기 (Learn more)
ion-note은 부제목이나 메타데이터를 보여줄 때 쓰는 작은 텍스트 컴포넌트예요. ion-item 안에 slot="start"나 slot="end"로 배치하면 라벨과 함께 배치되고, color나 --color를 이용해 색상을 자유롭게 바꿀 수 있습니다.