Skip to main content
Version: v8

ion-list-header

shadow

リストヘッダーは、リストの内容を記述するために使用されるブロック要素です。アイテムディバイダー](./item-divider)とは異なり、リストヘッダーはアイテムのリストの先頭で一度だけ使用する必要があります。

基本的な使い方

<ion-list>
<ion-list-header>
<ion-label>Video Games</ion-label>
</ion-list-header>
<ion-item>
<ion-label>Pokémon Yellow</ion-label>
</ion-item>
<ion-item>
<ion-label>Mega Man X</ion-label>
</ion-item>
<ion-item>
<ion-label>The Legend of Zelda</ion-label>
</ion-item>
<ion-item>
<ion-label>Pac-Man</ion-label>
</ion-item>
<ion-item>
<ion-label>Super Mario World</ion-label>
</ion-item>
</ion-list>

リストヘッダーのボタン

リストのヘッダーに button を配置すると、リストの一部を表示し、ボタンで全リストにリダイレクトするのに便利です。

<ion-list>
<ion-list-header>
<ion-label>Video Games</ion-label>
<ion-button>See All</ion-button>
</ion-list-header>
<ion-item>
<ion-label>Pokémon Yellow</ion-label>
</ion-item>
<ion-item>
<ion-label>Mega Man X</ion-label>
</ion-item>
<ion-item>
<ion-label>The Legend of Zelda</ion-label>
</ion-item>
<ion-item>
<ion-label>Pac-Man</ion-label>
</ion-item>
<ion-item>
<ion-label>Super Mario World</ion-label>
</ion-item>
</ion-list>

List Headerの下線

リストヘッダーは、デフォルトでは下部のボーダーが表示されません。 lines プロパティを "full" または "inset" に変更すると、それぞれ全幅のボーダーまたは左paddingを伴う挿入ボーダーが表示されます。

<ion-list>
<ion-list-header>
<ion-label>Default</ion-label>
</ion-list-header>
<ion-item>
<ion-label>Item</ion-label>
</ion-item>
<ion-item>
<ion-label>Item</ion-label>
</ion-item>
</ion-list>

<ion-list>
<ion-list-header lines="inset">
<ion-label>Inset</ion-label>
</ion-list-header>
<ion-item>
<ion-label>Item</ion-label>
</ion-item>
<ion-item>
<ion-label>Item</ion-label>
</ion-item>
</ion-list>

<ion-list>
<ion-list-header lines="full">
<ion-label>Full</ion-label>
</ion-list-header>
<ion-item>
<ion-label>Item</ion-label>
</ion-item>
<ion-item>
<ion-label>Item</ion-label>
</ion-item>
</ion-list>

テーマ

Colors

<ion-list-header>
<ion-label>Default</ion-label>
</ion-list-header>
<ion-list-header color="primary">
<ion-label>Primary</ion-label>
</ion-list-header>
<ion-list-header color="secondary">
<ion-label>Secondary</ion-label>
</ion-list-header>
<ion-list-header color="tertiary">
<ion-label>Tertiary</ion-label>
</ion-list-header>
<ion-list-header color="success">
<ion-label>Success</ion-label>
</ion-list-header>
<ion-list-header color="warning">
<ion-label>Warning</ion-label>
</ion-list-header>
<ion-list-header color="danger">
<ion-label>Danger</ion-label>
</ion-list-header>
<ion-list-header color="light">
<ion-label>Light</ion-label>
</ion-list-header>
<ion-list-header color="medium">
<ion-label>Medium</ion-label>
</ion-list-header>
<ion-list-header color="dark">
<ion-label>Dark</ion-label>
</ion-list-header>

CSSカスタムプロパティ

ion-list-header {
--background: #19422d;
--color: #fff;

--border-width: 0 0 4px 0;
--border-color: #f24aec;
--border-style: double;
}

プロパティ

color

Descriptionアプリケーションのカラーパレットから使用する色を指定します。デフォルトのオプションは以下の通りです。 "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", と "dark" です.色に関する詳しい情報は theming を参照してください。
Attributecolor
Type"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined
Defaultundefined

lines

Descriptionリストヘッダーの下辺のボーダーをどのように表示するか。
Attributelines
Type"full" | "inset" | "none" | undefined
Defaultundefined

mode

Descriptionmodeは、どのプラットフォームのスタイルを使用するかを決定します。
Attributemode
Type"ios" | "md"
Defaultundefined

イベント

No events available for this component.

メソッド

No public methods available for this component.

CSS Shadow Parts

No CSS shadow parts available for this component.

CSSカスタムプロパティ

NameDescription
--backgroundリストヘッダーの背景
--border-colorリストヘッダーボーダーの色
--border-styleリストヘッダーボーダーのスタイル
--border-widthリストヘッダー枠の幅
--colorリストヘッダーテキストの色
--inner-border-widthリストヘッダー内枠の幅

Slots

No slots available for this component.