A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://ionicframework.com/docs/api/grid below:

Display Grids for Mobile-First Custom App Layout

ion-grid shadow

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.

The default breakpoints for the grid and the corresponding properties are defined in the table below. Breakpoint values can not be customized at this time. For more information on why they can't be customized, see Variables in Media Queries.

Name Value Width Property Offset Property Push Property Pull Property Description xs 0 size offset push pull Set columns when (min-width: 0) sm 576px sizeSm offsetSm pushSm pullSm Set columns when (min-width: 576px) md 768px sizeMd offsetMd pushMd pullMd Set columns when (min-width: 768px) lg 992px sizeLg offsetLg pushLg pullLg Set columns when (min-width: 992px) xl 1200px sizeXl offsetXl pushXl pullXl Set columns when (min-width: 1200px)

By default, columns will take up equal width inside of a row for all devices and screen sizes.

Grids take up 100% width of their container. By adding the fixed property to the grid, the width will be set based on the screen size. The width of the grid for each breakpoint is listed in the table below, but it can be customized. For more information, see Customizing the Grid. Open the below example in StackBlitz and resize the screen to see the grid width change.

Name Value Description xs 100% Width is 100% for xs screens sm 540px Set grid width to 540px when (min-width: 576px) md 720px Set grid width to 720px when (min-width: 768px) lg 960px Set grid width to 960px when (min-width: 992px) xl 1140px Set grid width to 1140px when (min-width: 1200px)

Columns can be set to specific sizes to take up a certain number out of the total number of columns, or resize their width based on the content. The default number of columns is 12, but this can be customized. See the Number of Columns section below for more information.

Content-based size

By setting the size to "auto" the column can size itself based on the natural width of its content. This is necessary when setting a column to an absolute width, such as a specific number of pixels. The columns next to the auto-width column will resize to fill the row.

Specified size

Set the size of a column and the others will automatically resize around it. If a size is specified on all of the columns and it doesn't add up to the total number of columns, there will be empty space after the columns.

Responsive size

The size property will change the column width for all breakpoints. Column also provides several size properties with the breakpoint name appended to the end of "size". These properties can be used to change the width of the column based on the screen size. Open the below example in StackBlitz and resize the screen to see the column widths change.

Columns can be offset to shift to the right by a certain number of columns out of the total number of columns.

Specified offset

Columns can be moved to the right by using the offset property. This property increases the left margin of the column by the number of specified columns. It also shifts the columns to the right of it, if any exist.

Responsive offset

The offset property will change the column's left margin for all breakpoints. Column also provides several offset properties with the breakpoint name appended to the end of "offset". These properties can be used to change the offset of the column based on the screen size. Open the below example in StackBlitz and resize the screen to see the column offsets change.

Columns can be pushed to to the right or pulled to the left by a certain number of columns out of the total number of columns.

Specified push & pull

Reorder the columns by adding the push and pull properties. These properties adjust the left and right of the columns by the specified number of columns making it easy to reorder columns. This will cause columns to overlap if they are shifted to where another column is positioned.

Responsive push & pull

The push and pull properties will change the column's position for all breakpoints. Column also provides several push and pull properties with the breakpoint name appended to the end of "push" / "pull". These properties can be used to change the position of the column based on the screen size. Open the below example in StackBlitz and resize the screen to see the column positions change.

Vertical Alignment

All columns can be vertically aligned inside of a row by adding different classes to the row. For a list of available classes, see css utilities.

Horizontal Alignment

All columns can be horizontally aligned inside of a row by adding different classes to the row. For a list of available classes, see css utilities.

Using our built-in CSS variables, it’s possible to customize the predefined grid attributes. Change the values of the padding, the number of columns, and more.

Fixed Width

The width of a fixed grid can be set for all breakpoints with the --ion-grid-width CSS variable. To override individual breakpoints, use the --ion-grid-width-{breakpoint} CSS variables. The default value for each of the breakpoints can be found in the Fixed Grid section. Open the below example in StackBlitz and resize the screen to see the grid width change.

Number of Columns

The number of grid columns can be modified with the --ion-grid-columns CSS variable. By default there are 12 grid columns, but this can be changed to any positive integer and be used to calculate the width of each individual column.

Padding

The padding on the grid container can be set for all breakpoints with the --ion-grid-padding CSS variable. To override individual breakpoints, use the --ion-grid-padding-{breakpoint} CSS variables.

The padding on the columns can be set for all breakpoints with the --ion-grid-column-padding CSS variable. To override individual breakpoints, use the --ion-grid-column-padding-{breakpoint} CSS variables.

fixed Description If true, the grid will have a fixed width based on the screen size. Attribute fixed Type boolean Default false

No events available for this component.

No public methods available for this component.

No CSS shadow parts available for this component.

Name Description --ion-grid-padding Padding for the Grid --ion-grid-padding-lg Padding for the Grid on lg screens --ion-grid-padding-md Padding for the Grid on md screens --ion-grid-padding-sm Padding for the Grid on sm screens --ion-grid-padding-xl Padding for the Grid on xl screens --ion-grid-padding-xs Padding for the Grid on xs screens --ion-grid-width Width of the fixed Grid --ion-grid-width-lg Width of the fixed Grid on lg screens --ion-grid-width-md Width of the fixed Grid on md screens --ion-grid-width-sm Width of the fixed Grid on sm screens --ion-grid-width-xl Width of the fixed Grid on xl screens --ion-grid-width-xs Width of the fixed Grid on xs screens

No slots available for this component.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4