본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

ion-header

원문 보기 위키 갱신

Header는 페이지의 상단에 정렬되는 페이지의 루트 컴포넌트예요. 하나 이상의 toolbar를 감싸는 용도로 권장되지만, 어떤 요소든 감쌀 수 있습니다. header 안에서 toolbar를 사용하면 콘텐츠가 올바른 크기로 조정되고, header가 기기의 안전 영역(safe area)을 고려합니다.

출처: 문서

본문

Header는 페이지의 상단에 정렬되는 페이지의 루트 컴포넌트예요. 하나 이상의 toolbars를 감싸는 용도로 사용하는 것이 권장되지만, 어떤 요소든 감쌀 수 있어요. header 안에서 toolbar를 사용하면 콘텐츠가 올바른 크기로 조정되고, header가 기기의 안전 영역을 고려하게 됩니다.

기본 사용법 (Basic Usage)

JavaScript

<ion-header>
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
  <h1>Content</h1>
</ion-content>

Angular

src/app/example.component.html

<ion-header>
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
  <h1>Content</h1>
</ion-content>

src/app/example.component.ts

import { Component } from '@angular/core';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular';

@Component({
  selector: 'app-example',
  templateUrl: 'example.component.html',
  styleUrls: ['example.component.css'],
  imports: [IonContent, IonHeader, IonTitle, IonToolbar],
})
export class ExampleComponent {}

React

import React from 'react';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';

function Example() {
  return (
    <>
      <IonHeader>
        <IonToolbar>
          <IonTitle>Header</IonTitle>
        </IonToolbar>
      </IonHeader>
      <IonContent className="ion-padding">
        <h1>Content</h1>
      </IonContent>
    </>
  );
}
export default Example;

Vue

<template>
  <ion-header>
    <ion-toolbar>
      <ion-title>Header</ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content class="ion-padding">
    <h1>Content</h1>
  </ion-content>
</template>

<script setup lang="ts">
  import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/vue';
</script>

반투명 Header (Translucent Header)

Header는 translucent 프로퍼티를 설정하면 네이티브 iOS 애플리케이션에서 볼 수 있는 투명도를 구현할 수 있어요. 콘텐츠가 header 뒤로 스크롤되게 하려면 content에 fullscreen 프로퍼티를 설정해야 합니다. 이 효과는 mode가 "ios"이고 기기가 backdrop-filter를 지원할 때만 적용됩니다.

JavaScript

<ion-header translucent="true">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content fullscreen="true" class="ion-padding">
  <h1>Animal Facts</h1>

  <h2>Rhinoceros</h2>
  <img
    alt="rhino standing near grass"
    src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
  />
  <p>
    The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
    Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
    species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns, while
    the Javan rhino and one-horned rhino have one horn.
  </p>

  <h2>Sea Turtle</h2>
  <img
    alt="brown sea turtle in water"
    src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
  />
  <p>
    Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other turtles,
    sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are adapted for
    swimming, so they are vulnerable while on land.
  </p>

  <h2>Giraffe</h2>
  <img
    alt="giraffe sticking its tongue out"
    src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
  />
  <p>
    Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
    spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
    giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
  </p>

  <h2>Elephant</h2>
  <img
    alt="two grey elephants on grass plains during sunset"
    src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
  />
  <p>
    Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
    trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
    water for drinking or bathing.
  </p>

  <h2>Dolphin</h2>
  <img
    alt="black and white dolphin in water"
    src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
  />
  <p>
    Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray, blue,
    and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100 teeth
    and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to reveal a
    pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
  </p>
</ion-content>

Angular

src/app/example.component.html

<ion-header [translucent]="true">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true" class="ion-padding">
  <h1>Animal Facts</h1>

  <h2>Rhinoceros</h2>
  <img
    alt="rhino standing near grass"
    src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
  />
  <p>
    The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
    Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
    species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns, while
    the Javan rhino and one-horned rhino have one horn.
  </p>

  <h2>Sea Turtle</h2>
  <img
    alt="brown sea turtle in water"
    src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
  />
  <p>
    Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other turtles,
    sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are adapted for
    swimming, so they are vulnerable while on land.
  </p>

  <h2>Giraffe</h2>
  <img
    alt="giraffe sticking its tongue out"
    src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
  />
  <p>
    Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
    spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
    giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
  </p>

  <h2>Elephant</h2>
  <img
    alt="two grey elephants on grass plains during sunset"
    src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
  />
  <p>
    Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
    trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
    water for drinking or bathing.
  </p>

  <h2>Dolphin</h2>
  <img
    alt="black and white dolphin in water"
    src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
  />
  <p>
    Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray, blue,
    and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100 teeth
    and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to reveal a
    pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
  </p>
</ion-content>

src/app/example.component.ts

import { Component } from '@angular/core';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular';

@Component({
  selector: 'app-example',
  templateUrl: 'example.component.html',
  styleUrls: ['example.component.css'],
  imports: [IonContent, IonHeader, IonTitle, IonToolbar],
})
export class ExampleComponent {}

React

import React from 'react';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';

function Example() {
  return (
    <>
      <IonHeader translucent={true}>
        <IonToolbar>
          <IonTitle>Header</IonTitle>
        </IonToolbar>
      </IonHeader>
      <IonContent fullscreen={true} className="ion-padding">
        <h1>Animal Facts</h1>

        <h2>Rhinoceros</h2>
        <img
          alt="rhino standing near grass"
          src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
        />
        <p>
          The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from
          the Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on
          the species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two
          horns, while the Javan rhino and one-horned rhino have one horn.
        </p>

        <h2>Sea Turtle</h2>
        <img
          alt="brown sea turtle in water"
          src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
        />
        <p>
          Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
          turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
          adapted for swimming, so they are vulnerable while on land.
        </p>

        <h2>Giraffe</h2>
        <img
          alt="giraffe sticking its tongue out"
          src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
        />
        <p>
          Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have
          a spotted pattern similar to that of a leopard. Because of the combination of these features, some people
          called the giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
        </p>

        <h2>Elephant</h2>
        <img
          alt="two grey elephants on grass plains during sunset"
          src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
        />
        <p>
          Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’
          long trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or
          suck up water for drinking or bathing.
        </p>

        <h2>Dolphin</h2>
        <img
          alt="black and white dolphin in water"
          src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
        />
        <p>
          Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
          blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about
          100 teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that
          opens to reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
        </p>
      </IonContent>
    </>
  );
}
export default Example;

Vue

<template>
  <ion-header :translucent="true">
    <ion-toolbar>
      <ion-title>Header</ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content :fullscreen="true" class="ion-padding">
    <h1>Animal Facts</h1>

    <h2>Rhinoceros</h2>
    <img
      alt="rhino standing near grass"
      src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
      Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
      species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns,
      while the Javan rhino and one-horned rhino have one horn.
    </p>

    <h2>Sea Turtle</h2>
    <img
      alt="brown sea turtle in water"
      src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
    />
    <p>
      Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
      turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
      adapted for swimming, so they are vulnerable while on land.
    </p>

    <h2>Giraffe</h2>
    <img
      alt="giraffe sticking its tongue out"
      src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
    />
    <p>
      Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
      spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
      giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
    </p>

    <h2>Elephant</h2>
    <img
      alt="two grey elephants on grass plains during sunset"
      src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
    />
    <p>
      Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
      trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
      water for drinking or bathing.
    </p>

    <h2>Dolphin</h2>
    <img
      alt="black and white dolphin in water"
      src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
      blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100
      teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to
      reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
    </p>
  </ion-content>
</template>

<script setup lang="ts">
  import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/vue';
</script>

압축 Header (Condensed Header)

Ionic은 네이티브 iOS 애플리케이션에서 볼 수 있는, 큰 toolbar 타이틀을 표시하고 스크롤할 때 작은 타이틀로 축소하는 기능을 제공합니다. 이를 구현하려면 하나는 콘텐츠 위에, 하나는 콘텐츠 안에 두 개의 header를 추가하고, 콘텐츠 안의 header에 collapse 프로퍼티를 "condense"로 설정하면 돼요. 이 효과는 mode가 "ios"일 때만 적용됩니다.

JavaScript

<ion-header translucent="true">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content fullscreen="true">
  <ion-header collapse="condense">
    <ion-toolbar>
      <ion-title size="large">Header</ion-title>
    </ion-toolbar>
  </ion-header>

  <div class="ion-padding">
    <h1>Animal Facts</h1>

    <h2>Rhinoceros</h2>
    <img
      alt="rhino standing near grass"
      src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
      Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
      species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns,
      while the Javan rhino and one-horned rhino have one horn.
    </p>

    <h2>Sea Turtle</h2>
    <img
      alt="brown sea turtle in water"
      src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
    />
    <p>
      Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
      turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
      adapted for swimming, so they are vulnerable while on land.
    </p>

    <h2>Giraffe</h2>
    <img
      alt="giraffe sticking its tongue out"
      src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
    />
    <p>
      Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
      spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
      giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
    </p>

    <h2>Elephant</h2>
    <img
      alt="two grey elephants on grass plains during sunset"
      src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
    />
    <p>
      Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
      trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
      water for drinking or bathing.
    </p>

    <h2>Dolphin</h2>
    <img
      alt="black and white dolphin in water"
      src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
      blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100
      teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to
      reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
    </p>
  </div>
</ion-content>

Angular

src/app/example.component.html

<ion-header [translucent]="true">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
  <ion-header collapse="condense">
    <ion-toolbar>
      <ion-title size="large">Header</ion-title>
    </ion-toolbar>
  </ion-header>

  <div class="ion-padding">
    <h1>Animal Facts</h1>

    <h2>Rhinoceros</h2>
    <img
      alt="rhino standing near grass"
      src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
      Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
      species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns,
      while the Javan rhino and one-horned rhino have one horn.
    </p>

    <h2>Sea Turtle</h2>
    <img
      alt="brown sea turtle in water"
      src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
    />
    <p>
      Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
      turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
      adapted for swimming, so they are vulnerable while on land.
    </p>

    <h2>Giraffe</h2>
    <img
      alt="giraffe sticking its tongue out"
      src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
    />
    <p>
      Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
      spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
      giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
    </p>

    <h2>Elephant</h2>
    <img
      alt="two grey elephants on grass plains during sunset"
      src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
    />
    <p>
      Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
      trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
      water for drinking or bathing.
    </p>

    <h2>Dolphin</h2>
    <img
      alt="black and white dolphin in water"
      src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
      blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100
      teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to
      reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
    </p>
  </div>
</ion-content>

src/app/example.component.ts

import { Component } from '@angular/core';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular';

@Component({
  selector: 'app-example',
  templateUrl: 'example.component.html',
  styleUrls: ['example.component.css'],
  imports: [IonContent, IonHeader, IonTitle, IonToolbar],
})
export class ExampleComponent {}

React

import React from 'react';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';

function Example() {
  return (
    <>
      <IonHeader translucent={true}>
        <IonToolbar>
          <IonTitle>Header</IonTitle>
        </IonToolbar>
      </IonHeader>
      <IonContent fullscreen={true}>
        <IonHeader collapse="condense">
          <IonToolbar>
            <IonTitle size="large">Header</IonTitle>
          </IonToolbar>
        </IonHeader>

        <div className="ion-padding">
          <h1>Animal Facts</h1>

          <h2>Rhinoceros</h2>
          <img
            alt="rhino standing near grass"
            src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
          />
          <p>
            The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from
            the Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies
            on the species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have
            two horns, while the Javan rhino and one-horned rhino have one horn.
          </p>

          <h2>Sea Turtle</h2>
          <img
            alt="brown sea turtle in water"
            src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
          />
          <p>
            Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
            turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
            adapted for swimming, so they are vulnerable while on land.
          </p>

          <h2>Giraffe</h2>
          <img
            alt="giraffe sticking its tongue out"
            src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
          />
          <p>
            Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and
            have a spotted pattern similar to that of a leopard. Because of the combination of these features, some
            people called the giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes
            from.
          </p>

          <h2>Elephant</h2>
          <img
            alt="two grey elephants on grass plains during sunset"
            src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
          />
          <p>
            Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’
            long trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants,
            or suck up water for drinking or bathing.
          </p>

          <h2>Dolphin</h2>
          <img
            alt="black and white dolphin in water"
            src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
          />
          <p>
            Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown,
            gray, blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout
            with about 100 teeth and a streamlined body. They have a single blowhole on top of their head, which has a
            flap that opens to reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it
            surfaces.
          </p>
        </div>
      </IonContent>
    </>
  );
}
export default Example;

Vue

<template>
  <ion-header :translucent="true">
    <ion-toolbar>
      <ion-title>Header</ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content :fullscreen="true">
    <ion-header collapse="condense">
      <ion-toolbar>
        <ion-title size="large">Header</ion-title>
      </ion-toolbar>
    </ion-header>

    <div class="ion-padding">
      <h1>Animal Facts</h1>

      <h2>Rhinoceros</h2>
      <img
        alt="rhino standing near grass"
        src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
      />
      <p>
        The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
        Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
        species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns,
        while the Javan rhino and one-horned rhino have one horn.
      </p>

      <h2>Sea Turtle</h2>
      <img
        alt="brown sea turtle in water"
        src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
      />
      <p>
        Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
        turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
        adapted for swimming, so they are vulnerable while on land.
      </p>

      <h2>Giraffe</h2>
      <img
        alt="giraffe sticking its tongue out"
        src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
      />
      <p>
        Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
        spotted pattern similar to that of a leopard. Because of the combination of these features, some people called
        the giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
      </p>

      <h2>Elephant</h2>
      <img
        alt="two grey elephants on grass plains during sunset"
        src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
      />
      <p>
        Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’
        long trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or
        suck up water for drinking or bathing.
      </p>

      <h2>Dolphin</h2>
      <img
        alt="black and white dolphin in water"
        src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
      />
      <p>
        Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
        blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about
        100 teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens
        to reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
      </p>
    </div>
  </ion-content>
</template>

<script setup lang="ts">
  import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/vue';
</script>

페이드 Header (Fade Header)

많은 네이티브 iOS 애플리케이션은 toolbar에 페이드 효과가 있습니다. header의 collapse 프로퍼티를 "fade"로 설정하면 이 효과를 구현할 수 있어요. 페이지가 처음 로드되면 header의 배경과 테두리가 숨겨집니다. 콘텐츠가 스크롤되면서 header가 다시 페이드 인됩니다. 이 효과는 mode가 "ios"일 때만 적용됩니다.

이 기능은 Condensed Header와 결합할 수도 있습니다. "fade"로 설정된 collapse 프로퍼티는 콘텐츠 바깥의 header에 있어야 합니다.

JavaScript

<ion-header collapse="fade">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
  <h1>Animal Facts</h1>

  <h2>Rhinoceros</h2>
  <img
    alt="rhino standing near grass"
    src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
  />
  <p>
    The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
    Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
    species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns, while
    the Javan rhino and one-horned rhino have one horn.
  </p>

  <h2>Sea Turtle</h2>
  <img
    alt="brown sea turtle in water"
    src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
  />
  <p>
    Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other turtles,
    sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are adapted for
    swimming, so they are vulnerable while on land.
  </p>

  <h2>Giraffe</h2>
  <img
    alt="giraffe sticking its tongue out"
    src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
  />
  <p>
    Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
    spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
    giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
  </p>

  <h2>Elephant</h2>
  <img
    alt="two grey elephants on grass plains during sunset"
    src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
  />
  <p>
    Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
    trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
    water for drinking or bathing.
  </p>

  <h2>Dolphin</h2>
  <img
    alt="black and white dolphin in water"
    src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
  />
  <p>
    Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray, blue,
    and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100 teeth
    and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to reveal a
    pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
  </p>
</ion-content>

Angular

src/app/example.component.html

<ion-header collapse="fade">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
  <h1>Animal Facts</h1>

  <h2>Rhinoceros</h2>
  <img
    alt="rhino standing near grass"
    src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
  />
  <p>
    The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
    Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
    species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns, while
    the Javan rhino and one-horned rhino have one horn.
  </p>

  <h2>Sea Turtle</h2>
  <img
    alt="brown sea turtle in water"
    src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
  />
  <p>
    Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other turtles,
    sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are adapted for
    swimming, so they are vulnerable while on land.
  </p>

  <h2>Giraffe</h2>
  <img
    alt="giraffe sticking its tongue out"
    src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
  />
  <p>
    Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
    spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
    giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
  </p>

  <h2>Elephant</h2>
  <img
    alt="two grey elephants on grass plains during sunset"
    src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
  />
  <p>
    Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
    trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
    water for drinking or bathing.
  </p>

  <h2>Dolphin</h2>
  <img
    alt="black and white dolphin in water"
    src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
  />
  <p>
    Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray, blue,
    and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100 teeth
    and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to reveal a
    pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
  </p>
</ion-content>

src/app/example.component.ts

import { Component } from '@angular/core';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular';

@Component({
  selector: 'app-example',
  templateUrl: 'example.component.html',
  styleUrls: ['example.component.css'],
  imports: [IonContent, IonHeader, IonTitle, IonToolbar],
})
export class ExampleComponent {}

React

import React from 'react';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';

function Example() {
  return (
    <>
      <IonHeader collapse="fade">
        <IonToolbar>
          <IonTitle>Header</IonTitle>
        </IonToolbar>
      </IonHeader>
      <IonContent className="ion-padding">
        <h1>Animal Facts</h1>

        <h2>Rhinoceros</h2>
        <img
          alt="rhino standing near grass"
          src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
        />
        <p>
          The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from
          the Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on
          the species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two
          horns, while the Javan rhino and one-horned rhino have one horn.
        </p>

        <h2>Sea Turtle</h2>
        <img
          alt="brown sea turtle in water"
          src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
        />
        <p>
          Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
          turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
          adapted for swimming, so they are vulnerable while on land.
        </p>

        <h2>Giraffe</h2>
        <img
          alt="giraffe sticking its tongue out"
          src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
        />
        <p>
          Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have
          a spotted pattern similar to that of a leopard. Because of the combination of these features, some people
          called the giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
        </p>

        <h2>Elephant</h2>
        <img
          alt="two grey elephants on grass plains during sunset"
          src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
        />
        <p>
          Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’
          long trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or
          suck up water for drinking or bathing.
        </p>

        <h2>Dolphin</h2>
        <img
          alt="black and white dolphin in water"
          src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
        />
        <p>
          Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
          blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about
          100 teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that
          opens to reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
        </p>
      </IonContent>
    </>
  );
}
export default Example;

Vue

<template>
  <ion-header collapse="fade">
    <ion-toolbar>
      <ion-title>Header</ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content class="ion-padding">
    <h1>Animal Facts</h1>

    <h2>Rhinoceros</h2>
    <img
      alt="rhino standing near grass"
      src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
      Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
      species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns,
      while the Javan rhino and one-horned rhino have one horn.
    </p>

    <h2>Sea Turtle</h2>
    <img
      alt="brown sea turtle in water"
      src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
    />
    <p>
      Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
      turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
      adapted for swimming, so they are vulnerable while on land.
    </p>

    <h2>Giraffe</h2>
    <img
      alt="giraffe sticking its tongue out"
      src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
    />
    <p>
      Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
      spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
      giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
    </p>

    <h2>Elephant</h2>
    <img
      alt="two grey elephants on grass plains during sunset"
      src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
    />
    <p>
      Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
      trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
      water for drinking or bathing.
    </p>

    <h2>Dolphin</h2>
    <img
      alt="black and white dolphin in water"
      src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
      blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100
      teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to
      reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
    </p>
  </ion-content>
</template>

<script setup lang="ts">
  import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/vue';
</script>

가상 스크롤과 함께 사용하기 (Usage with Virtual Scroll)

페이드 header가 제대로 작동하려면 스크롤 컨테이너가 필요합니다. 가상 스크롤링 솔루션을 사용할 때는 커스텀 스크롤 대상을 제공해야 해요. content의 스크롤링을 비활성화하고, 스크롤을 담당하는 요소에 .ion-content-scroll-host 클래스를 추가해야 합니다.

JavaScript

<ion-header collapse="fade">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content scroll-y="false">
  <div class="ion-content-scroll-host ion-padding">
    <h1>Animal Facts</h1>

    <h2>Rhinoceros</h2>
    <img alt="rhino standing near grass" src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80" />
    <p>The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns, while the Javan rhino and one-horned rhino have one horn.</p>

    <h2>Sea Turtle</h2>
    <img alt="brown sea turtle in water" src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80" />
    <p>Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are adapted for swimming, so they are vulnerable while on land.</p>

    <h2>Giraffe</h2>
    <img alt="giraffe sticking its tongue out" src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80" />
    <p>Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.</p>

    <h2>Elephant</h2>
    <img alt="two grey elephants on grass plains during sunset" src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80" />
    <p>Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up water for drinking or bathing.</p>

    <h2>Dolphin</h2>
    <img alt="black and white dolphin in water" src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80" />
    <p>Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray, blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100 teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.</p>
</ion-content>

<style>
  .ion-content-scroll-host {
    position: absolute;
    top: 0;
    left: 0;

    height: 100%;
    width: 100%;
    overflow-y: auto;
  }
</style>

Angular

src/app/example.component.html

<ion-header collapse="fade">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content [scrollY]="false">
  <div class="ion-content-scroll-host ion-padding">
    <h1>Animal Facts</h1>

    <h2>Rhinoceros</h2>
    <img
      alt="rhino standing near grass"
      src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
      Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
      species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns,
      while the Javan rhino and one-horned rhino have one horn.
    </p>

    <h2>Sea Turtle</h2>
    <img
      alt="brown sea turtle in water"
      src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
    />
    <p>
      Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
      turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
      adapted for swimming, so they are vulnerable while on land.
    </p>

    <h2>Giraffe</h2>
    <img
      alt="giraffe sticking its tongue out"
      src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
    />
    <p>
      Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
      spotted pattern similar to that of a leopard. Because of the combination of these features, some people called the
      giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
    </p>

    <h2>Elephant</h2>
    <img
      alt="two grey elephants on grass plains during sunset"
      src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
    />
    <p>
      Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’ long
      trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or suck up
      water for drinking or bathing.
    </p>

    <h2>Dolphin</h2>
    <img
      alt="black and white dolphin in water"
      src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
    />
    <p>
      Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
      blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about 100
      teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens to
      reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
    </p>
  </div>
</ion-content>

src/app/example.component.css

.ion-content-scroll-host {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  overflow-y: auto;
}

src/app/example.component.ts

import { Component } from '@angular/core';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular';

@Component({
  selector: 'app-example',
  templateUrl: 'example.component.html',
  styleUrls: ['example.component.css'],
  imports: [IonContent, IonHeader, IonTitle, IonToolbar],
})
export class ExampleComponent {}

React

src/main.tsx

import React from 'react';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';

import './main.css';

function Example() {
  return (
    <>
      <IonHeader collapse="fade">
        <IonToolbar>
          <IonTitle>Header</IonTitle>
        </IonToolbar>
      </IonHeader>
      <IonContent scrollY={false}>
        <div className="ion-content-scroll-host ion-padding">
          <h1>Animal Facts</h1>

          <h2>Rhinoceros</h2>
          <img
            alt="rhino standing near grass"
            src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
          />
          <p>
            The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from
            the Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies
            on the species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have
            two horns, while the Javan rhino and one-horned rhino have one horn.
          </p>

          <h2>Sea Turtle</h2>
          <img
            alt="brown sea turtle in water"
            src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
          />
          <p>
            Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
            turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
            adapted for swimming, so they are vulnerable while on land.
          </p>

          <h2>Giraffe</h2>
          <img
            alt="giraffe sticking its tongue out"
            src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
          />
          <p>
            Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and
            have a spotted pattern similar to that of a leopard. Because of the combination of these features, some
            people called the giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes
            from.
          </p>

          <h2>Elephant</h2>
          <img
            alt="two grey elephants on grass plains during sunset"
            src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
          />
          <p>
            Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’
            long trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants,
            or suck up water for drinking or bathing.
          </p>

          <h2>Dolphin</h2>
          <img
            alt="black and white dolphin in water"
            src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
          />
          <p>
            Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown,
            gray, blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout
            with about 100 teeth and a streamlined body. They have a single blowhole on top of their head, which has a
            flap that opens to reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it
            surfaces.
          </p>
        </div>
      </IonContent>
    </>
  );
}
export default Example;

src/main.css

.ion-content-scroll-host {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  overflow-y: auto;
}

Vue

<template>
  <ion-header collapse="fade">
    <ion-toolbar>
      <ion-title>Header</ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content :scroll-y="false">
    <div class="ion-content-scroll-host ion-padding">
      <h1>Animal Facts</h1>

      <h2>Rhinoceros</h2>
      <img
        alt="rhino standing near grass"
        src="https://images.unsplash.com/flagged/photo-1556983257-71fddc36bc75?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
      />
      <p>
        The rhinoceros gets its name from one of its most notable features: its horns. The word rhinoceros come from the
        Greek words rhino meaning “nose” and ceros meaning “horn.” The number of horns that a rhino has varies on the
        species. The two African species (the black rhino and the white rhino) and the Sumatran rhino have two horns,
        while the Javan rhino and one-horned rhino have one horn.
      </p>

      <h2>Sea Turtle</h2>
      <img
        alt="brown sea turtle in water"
        src="https://images.unsplash.com/photo-1573551089778-46a7abc39d9f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1974&q=80"
      />
      <p>
        Sea turtles are characterized by a large, streamlined shell and non-retractile head and limbs. Unlike other
        turtles, sea turtles cannot pull their limbs and head inside their shells. Their limbs are flippers that are
        adapted for swimming, so they are vulnerable while on land.
      </p>

      <h2>Giraffe</h2>
      <img
        alt="giraffe sticking its tongue out"
        src="https://images.unsplash.com/photo-1577114995803-d8ce0e2b4aa9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1746&q=80"
      />
      <p>
        Giraffes are known for their long, tall appearance. They have a small hump on their back like a camel and have a
        spotted pattern similar to that of a leopard. Because of the combination of these features, some people called
        the giraffe a “camel-leopard.” That’s where the giraffe’s species name “camelopardalis” comes from.
      </p>

      <h2>Elephant</h2>
      <img
        alt="two grey elephants on grass plains during sunset"
        src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1754&q=80"
      />
      <p>
        Elephants are the largest existing land animal, with massive bodies, large ears, and long trunks. Elephants’
        long trunks are multifunctional. They are used to pick up objects, trumpet warnings, greet other elephants, or
        suck up water for drinking or bathing.
      </p>

      <h2>Dolphin</h2>
      <img
        alt="black and white dolphin in water"
        src="https://images.unsplash.com/photo-1607153333879-c174d265f1d2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1742&q=80"
      />
      <p>
        Dolphins range in color depending on the species, from white, pearl, and pink to darker shades of brown, gray,
        blue, and black. They have smooth skin, flippers, and a dorsal fin. They have a long, slender snout with about
        100 teeth and a streamlined body. They have a single blowhole on top of their head, which has a flap that opens
        to reveal a pair of nostrils. The dolphin uses these nostrils for breathing when it surfaces.
      </p>
    </div>
  </ion-content>
</template>

<script setup lang="ts">
  import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/vue';
</script>

<style scoped>
  .ion-content-scroll-host {
    position: absolute;
    top: 0;
    left: 0;

    height: 100%;
    width: 100%;
    overflow-y: auto;
  }
</style>

테두리 (Borders)

"md" 모드에서는 header 아래쪽에 box-shadow가 적용됩니다. "ios" 모드에서는 아래쪽에 border가 적용되어요. header에 .ion-no-border 클래스를 추가하면 이를 제거할 수 있습니다.

JavaScript

<ion-header class="ion-no-border">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
  <h1>Content</h1>
</ion-content>

Angular

src/app/example.component.html

<ion-header class="ion-no-border">
  <ion-toolbar>
    <ion-title>Header</ion-title>
  </ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
  <h1>Content</h1>
</ion-content>

src/app/example.component.ts

import { Component } from '@angular/core';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular';

@Component({
  selector: 'app-example',
  templateUrl: 'example.component.html',
  styleUrls: ['example.component.css'],
  imports: [IonContent, IonHeader, IonTitle, IonToolbar],
})
export class ExampleComponent {}

React

import React from 'react';
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';

function Example() {
  return (
    <>
      <IonHeader className="ion-no-border">
        <IonToolbar>
          <IonTitle>Header</IonTitle>
        </IonToolbar>
      </IonHeader>
      <IonContent className="ion-padding">
        <h1>Content</h1>
      </IonContent>
    </>
  );
}
export default Example;

Vue

<template>
  <ion-header class="ion-no-border">
    <ion-toolbar>
      <ion-title>Header</ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content class="ion-padding">
    <h1>Content</h1>
  </ion-content>
</template>

<script setup lang="ts">
  import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/vue';
</script>

Properties

collapse

설명: header에 적용될 스크롤 효과를 설명합니다. iOS 모드에서만 적용됩니다. 일반적으로 Collapsible Large Titles에 사용됩니다.

속성(Attribute): collapse

타입(Type): "condense" | "fade" | undefined

기본값(Default): undefined

mode

설명: mode는 어떤 플랫폼 스타일을 사용할지 결정합니다. 이는 virtual property로, 초기화 시 한 번 설정되며 첫 렌더링 후 값을 변경해도 업데이트되지 않습니다.

속성(Attribute): mode

타입(Type): "ios" | "md"

기본값(Default): undefined

translucent

설명: true로 설정하면 header가 반투명해집니다. mode가 "ios"이고 기기가 backdrop-filter를 지원할 때만 적용됩니다. 참고: 콘텐츠가 header 뒤로 스크롤되게 하려면 content에 fullscreen 속성을 설정해야 합니다.

속성(Attribute): translucent

타입(Type): boolean

기본값(Default): false

Events

이 컴포넌트에 사용 가능한 이벤트가 없습니다.

Methods

이 컴포넌트에 사용 가능한 공개 메서드가 없습니다.

CSS Shadow Parts

이 컴포넌트에 사용 가능한 CSS shadow parts가 없습니다.

CSS Custom Properties

이 컴포넌트에 사용 가능한 CSS custom properties가 없습니다.

Slots

이름(Name) 설명(Description)
기본 슬롯(default slot) 입니다.

더 알아보기 (Learn more)

ion-header는 페이지 상단에 고정적으로 배치되는 루트 컴포넌트예요. 보통 하나 이상의 ion-toolbar를 감싸며, toolbar를 사용하면 iOS/Android의 안전 영역을 자동으로 고려합니다. translucent 프로퍼티로 반투명 효과를, collapse="condense"로 큰 타이틀 축소 효과를, collapse="fade"로 페이드 효과를 낼 수 있고, .ion-no-border 클래스로 테두리를 제거할 수 있어요.