Skip to main content
Version: v5

ion-grid

The grid is a powerful mobile-first flexbox system for building custom layouts.

It is composed of three units — a grid, row(s) and column(s). Columns will expand to fill the row, and will resize to fit additional columns. It is based on a 12 column layout with different breakpoints based on the screen size. The number of columns can be customized using CSS.

See the Responsive Grid documentation for more information.

Usage

<ion-grid>
<ion-row>
<ion-col> ion-col </ion-col>
<ion-col> ion-col </ion-col>
<ion-col> ion-col </ion-col>
<ion-col> ion-col </ion-col>
</ion-row>

<ion-row>
<ion-col size="6"> ion-col [size="6"] </ion-col>
<ion-col> ion-col </ion-col>
<ion-col> ion-col </ion-col>
</ion-row>

<ion-row>
<ion-col size="3"> ion-col [size="3"] </ion-col>
<ion-col> ion-col </ion-col>
<ion-col size="3"> ion-col [size="3"] </ion-col>
</ion-row>

<ion-row>
<ion-col size="3"> ion-col [size="3"] </ion-col>
<ion-col size="3" offset="3"> ion-col [size="3"] [offset="3"] </ion-col>
</ion-row>

<ion-row>
<ion-col> ion-col </ion-col>
<ion-col>
ion-col
<br />#
</ion-col>
<ion-col>
ion-col
<br /># <br />#
</ion-col>
<ion-col>
ion-col
<br /># <br /># <br />#
</ion-col>
</ion-row>

<ion-row>
<ion-col class="ion-align-self-start"> ion-col [start] </ion-col>
<ion-col class="ion-align-self-center"> ion-col [center] </ion-col>
<ion-col class="ion-align-self-end"> ion-col [end] </ion-col>
<ion-col>
ion-col
<br /># <br />#
</ion-col>
</ion-row>

<ion-row class="ion-align-items-start">
<ion-col> [start] ion-col </ion-col>
<ion-col> [start] ion-col </ion-col>
<ion-col class="ion-align-self-end"> [start] ion-col [end] </ion-col>
<ion-col>
ion-col
<br /># <br />#
</ion-col>
</ion-row>

<ion-row class="ion-align-items-center">
<ion-col> [center] ion-col </ion-col>
<ion-col> [center] ion-col </ion-col>
<ion-col> [center] ion-col </ion-col>
<ion-col>
ion-col
<br /># <br />#
</ion-col>
</ion-row>

<ion-row class="ion-align-items-end">
<ion-col> [end] ion-col </ion-col>
<ion-col class="ion-align-self-start"> [end] ion-col [start] </ion-col>
<ion-col> [end] ion-col </ion-col>
<ion-col>
ion-col
<br /># <br />#
</ion-col>
</ion-row>

<ion-row>
<ion-col size="12" size-sm> ion-col [size="12"] [size-sm] </ion-col>
<ion-col size="12" size-sm> ion-col [size="12"] [size-sm] </ion-col>
<ion-col size="12" size-sm> ion-col [size="12"] [size-sm] </ion-col>
<ion-col size="12" size-sm> ion-col [size="12"] [size-sm] </ion-col>
</ion-row>

<ion-row>
<ion-col size="12" size-md> ion-col [size="12"] [size-md] </ion-col>
<ion-col size="12" size-md> ion-col [size="12"] [size-md] </ion-col>
<ion-col size="12" size-md> ion-col [size="12"] [size-md] </ion-col>
<ion-col size="12" size-md> ion-col [size="12"] [size-md] </ion-col>
</ion-row>

<ion-row>
<ion-col size="6" size-lg offset="3"> ion-col [size="6"] [size-lg] [offset="3"] </ion-col>
<ion-col size="3" size-lg> ion-col [size="3"] [size-lg] </ion-col>
</ion-row>
</ion-grid>

Properties

fixed

Descriptiontrueの場合、グリッドの幅は画面サイズに応じた固定幅となる。
Attributefixed
Typeboolean
Defaultfalse

Events

No events available for this component.

Methods

No public methods available for this component.

CSS Shadow Parts

No CSS shadow parts available for this component.

CSS Custom Properties

NameDescription
--ion-grid-paddingグリッドのPadding
--ion-grid-padding-lgLG画面でのグリッドのPadding
--ion-grid-padding-mdmd画面におけるグリッドのPadding
--ion-grid-padding-smスマートスクリーンにおけるグリッドのPadding
--ion-grid-padding-xlXL画面でのグリッドのPadding
--ion-grid-padding-xsxs画面でのGridのPadding
--ion-grid-width固定Gridの幅
--ion-grid-width-lgLGスクリーンで固定されたGridの幅
--ion-grid-width-mdmd画面での固定Gridの幅
--ion-grid-width-smsm画面での固定Gridの幅
--ion-grid-width-xlxl画面での固定Gridの幅
--ion-grid-width-xsxsスクリーンで固定されたGridの幅

Slots

No slots available for this component.

View Source