CoreUI Angular Logo
Framework:
  • JavaScript / Vanilla JS
  • React.js
  • Vue.js
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewDate PickerPRODate Range PickerPROForm ControlSelectMulti SelectPROChecks & RadiosPassword InputPRORangeRange SliderPRORatingPROStepperPROInput GroupFloating LabelsLayoutTime PickerPROValidationComponentsAccordionAlertAvatarBadgeBreadcrumbButtonButton GroupCalendarPROCalloutCardCarouselClose buttonCollapseDropdownFooterHeaderImageList GroupLoading ButtonPROModalNavNavbarOffcanvasPaginationPlaceholderPopoverProgressSmart PaginationPROSmart TablePROSidebarSpinnerTableTabsNewToastTooltipWidgetsIconsChartsTemplatesNewAdmin & DashboardDownloadInstallationCustomizeContentMigrationv4 → v5v3 → v4Angular version


DownloadHire UsGet CoreUI PRO
On this page
  • How they work
  • Alignment
  • Vertical alignment
  • Horizontal alignment
  • Column wrapping
  • Column breaks
  • Reordering
  • Order props
  • Offsetting columns
  • Offset prop
  • Margin utilities
  • Standalone columns
  • API reference
  • Grid Module
  • c-col cCol

Angular Columns

Learn how to modify columns with a handful of options for alignment, ordering, and offsetting thanks to flexbox grid system.

How they work

  • Columns build on the grid's flexbox architecture. Flexbox means we have options for changing individual columns and modifying groups of columns at the row level. You choose how columns grow, shrink, or otherwise change.

  • When building grid layouts, all content goes in columns. The hierarchy of CoreUI grid goes from container to row to column to your content. On rare occasions, you may combine content and column, but be aware there can be unintended consequences.

  • CoreUI for Angular includes predefined components for creating fast, responsive layouts. With six breakpoints and a dozen columns at each grid tier, we have dozens of components already built for you to create your desired layouts. This can be disabled via Sass if you wish.


Alignment

Use flexbox alignment utilities to vertically and horizontally align columns.

Vertical alignment

One of three columnsOne of three columnsOne of three columnsOne of three columnsOne of three columnsOne of three columnsOne of three columnsOne of three columnsOne of three columns
<c-container>
  <c-row class="align-items-start">
    <c-col>One of three columns</c-col>
    <c-col>One of three columns</c-col>
    <c-col>One of three columns</c-col>
  </c-row>
  <c-row class="align-items-center">
    <c-col>One of three columns</c-col>
    <c-col>One of three columns</c-col>
    <c-col>One of three columns</c-col>
  </c-row>
  <c-row class="align-items-end">
    <c-col>One of three columns</c-col>
    <c-col>One of three columns</c-col>
    <c-col>One of three columns</c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns01',
  templateUrl: './columns01.component.html',
  styleUrls: ['./columns01.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns01Component {}
:host {
  .row {
    background-color: rgba(255, 0, 0, .1);
    min-height: 10rem;
  }

  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}
One of three columnsOne of three columnsOne of three columns
<c-container>
  <c-row>
    <c-col class="align-self-start">One of three columns</c-col>
    <c-col class="align-self-center">One of three columns</c-col>
    <c-col class="align-self-end">One of three columns</c-col>
  </c-row>
</c-container>

import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns02',
  templateUrl: './columns02.component.html',
  styleUrls: ['./columns01.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns02Component {}
:host {
  .row {
    background-color: rgba(255, 0, 0, .1);
    min-height: 10rem;
  }

  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

Horizontal alignment

One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns One of two columns
<c-container>
  <c-row class="justify-content-start">
    <c-col xs="4">
      One of two columns
    </c-col>
    <c-col xs="4">
      One of two columns
    </c-col>
  </c-row>
  <c-row class="justify-content-center">
    <c-col xs="4">
      One of two columns
    </c-col>
    <c-col xs="4">
      One of two columns
    </c-col>
  </c-row>
  <c-row class="justify-content-end">
    <c-col xs="4">
      One of two columns
    </c-col>
    <c-col xs="4">
      One of two columns
    </c-col>
  </c-row>
  <c-row class="justify-content-around">
    <c-col xs="4">
      One of two columns
    </c-col>
    <c-col xs="4">
      One of two columns
    </c-col>
  </c-row>
  <c-row class="justify-content-between">
    <c-col xs="4">
      One of two columns
    </c-col>
    <c-col xs="4">
      One of two columns
    </c-col>
  </c-row>
  <c-row class="justify-content-evenly">
    <c-col xs="4">
      One of two columns
    </c-col>
    <c-col xs="4">
      One of two columns
    </c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns03',
  templateUrl: './columns03.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns03Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

Column wrapping

If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.

.col-9 .col-4
Since 9 + 4 = 13 > 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.
.col-6
Subsequent columns continue along the new line.
<c-container>
  <c-row>
    <c-col xs="9">.col-9</c-col>
    <c-col xs="4">
      .col-4
      <br />
      Since 9 + 4 = 13 &gt; 12, this 4-column-wide div gets wrapped onto a new line as one
      contiguous unit.
    </c-col>
    <c-col xs="6">
      .col-6
      <br />
      Subsequent columns continue along the new line.
    </c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns04',
  templateUrl: './columns04.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns04Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

Column breaks

Breaking columns to a new line in flexbox requires a small hack - add an element with width: 100% wherever you want to wrap your columns to a new line. Normally this is accomplished with multiple c-rows, but not every implementation method can account for this.

.col-6 .col-sm-3.col-6 .col-sm-3
.col-6 .col-sm-3.col-6 .col-sm-3
<c-container>
  <c-row>
    <c-col xs="6" sm="3">.col-6 .col-sm-3</c-col>
    <c-col xs="6" sm="3">.col-6 .col-sm-3</c-col>
    <div class="w-100"></div>
    <c-col xs="6" sm="3">.col-6 .col-sm-3</c-col>
    <c-col xs="6" sm="3">.col-6 .col-sm-3</c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns05',
  templateUrl: './columns05.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns05Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

You may also apply this break at specific breakpoints with our responsive display utilities.

.col-6 .col-sm-4 .col-6 .col-sm-4
.col-6 .col-sm-4 .col-6 .col-sm-4
<c-container>
  <c-row>
    <c-col xs="6" sm="4">
      .col-6 .col-sm-4
    </c-col>
    <c-col xs="6" sm="4">
      .col-6 .col-sm-4
    </c-col>
    <div class="w-100 d-none d-md-block"></div>
    <c-col xs="6" sm="4">
      .col-6 .col-sm-4
    </c-col>
    <c-col xs="6" sm="4">
      .col-6 .col-sm-4
    </c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns06',
  templateUrl: './columns06.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns06Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

Reordering

Order props

Use order="1" (first, 1..5, last) props for controlling the visual order of your content. These props are responsive, so you can set the order by breakpoint (e.g., order="{xs: 1, md: 2}"). Includes support for 1 through 5 across all six grid tiers.

First in DOM, no order applied Second in DOM, with a larger order Third in DOM, with an order of 1
<c-container>
  <c-row>
    <c-col>
      First in DOM, no order applied
    </c-col>
    <c-col [order]="5">
      Second in DOM, with a larger order
    </c-col>
    <c-col [order]="{xs: 1}">
      Third in DOM, with an order of 1
    </c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns07',
  templateUrl: './columns07.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns07Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

There are also responsive props order="first" and order="last" with responsive variations order={xs: "last", sm: "first"} that change the order of an element by applying order: -1 and order: 6, respectively. These values can also be intermixed with the numbered 1..5 values as needed.

First in DOM, ordered last Second in DOM, unordered Third in DOM, ordered first
<c-container>
  <c-row>
    <c-col order="last">
      First in DOM, ordered last
    </c-col>
    <c-col>
      Second in DOM, unordered
    </c-col>
    <c-col [order]="{ xs: 'first' }">
      Third in DOM, ordered first
    </c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns08',
  templateUrl: './columns08.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns08Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

Offsetting columns

You can offset grid columns in two ways: our col props offset="0..12" with responsive variations offset={md: 2, lg: 3} col props and our margin utilities. Grid props are sized to match columns while margins are more useful for quick layouts where the width of the offset is variable.

Offset prop

Move columns to the right using offset={ md: * } props. These props increase the left margin of a column by * columns. For example, offset={ md: 4 } moves .col-md-4 over four columns.

.col-md-4.col-md-4 .offset-md-4.col-md-3 .offset-md-3.col-md-3 .offset-md-3.col-md-6 .offset-md-3
<c-container>
  <c-row>
    <c-col md="4">.col-md-4</c-col>
    <c-col md="4" [offset]="{md: 4}" >.col-md-4 .offset-md-4</c-col>
  </c-row>
  <c-row>
    <c-col md="3" [offset]="{md: 3}" >.col-md-3 .offset-md-3</c-col>
    <c-col md="3" [offset]="{md: 3}">.col-md-3 .offset-md-3</c-col>
  </c-row>
  <c-row>
    <c-col md="6" [offset]="{md: 3}">.col-md-6 .offset-md-3</c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns09',
  templateUrl: './columns09.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns09Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}
.col-sm-5 .col-md-6 .col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0 .col-sm-6 .col-md-5 .col-lg-6 .col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0
<c-container>
  <c-row>
    <c-col sm="5" md="6">
      .col-sm-5 .col-md-6
    </c-col>
    <c-col sm="5" md="6" [offset]="{sm: 2, md: 0}">
      .col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0
    </c-col>
  </c-row>
  <c-row>
    <c-col sm="6" md="5" lg="6">
      .col-sm-6 .col-md-5 .col-lg-6
    </c-col>
    <c-col sm="6" md="5" lg="6" [offset]="{md: 2, lg: 0}">
      .col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0
    </c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns10',
  templateUrl: './columns10.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns10Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

Margin utilities

You can use margin utilities like .me-auto to force sibling columns away from one another.

.col-md-4.col-md-4 .ms-auto.col-md-3 .ms-md-auto.col-md-3 .ms-md-auto.col-auto .me-auto.col-auto
<c-container>
  <c-row>
    <c-col md="4">.col-md-4</c-col>
    <c-col md="4" class="ms-auto">.col-md-4 .ms-auto</c-col>
  </c-row>
  <c-row>
    <c-col md="3" class="ms-md-auto">.col-md-3 .ms-md-auto</c-col>
    <c-col md="3" class="ms-md-auto">.col-md-3 .ms-md-auto</c-col>
  </c-row>
  <c-row>
    <c-col xs="auto" class="me-auto">.col-auto .me-auto</c-col>
    <c-col xs="auto">.col-auto</c-col>
  </c-row>
</c-container>
import { Component } from '@angular/core';
import { ColComponent, ContainerComponent, RowComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns11',
  templateUrl: './columns11.component.html',
  styleUrls: ['./columns11.component.scss'],
  standalone: true,
  imports: [ContainerComponent, RowComponent, ColComponent]
})
export class Columns11Component {}
:host {

  .row+.row {
    margin-top: 1rem;
  }

  c-col {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

Standalone columns

The c-col component can also be used outside a c-row to give an element a specific width. Whenever column component are used as non direct children of a row, the paddings are omitted.

.col-3: width of 25% .col-sm-9: width of 75% above sm breakpoint
<c-col xs="3" class="bg-light p-3 border">
  .col-3: width of 25%
</c-col>
<c-col sm="9" class="bg-light p-3 border">
  .col-sm-9: width of 75% above sm breakpoint
</c-col>
import { Component } from '@angular/core';
import { ColComponent } from '@coreui/angular';

@Component({
  selector: 'docs-columns12',
  templateUrl: './columns12.component.html',
  styleUrls: ['./columns03.component.scss'],
  standalone: true,
  imports: [ColComponent]
})
export class Columns12Component {}
:host {
  .row+.row {
    margin-top: 1rem;
  }

  .row > .col, .row > [class^=col-] {
    background-color: rgba(39, 41, 43, .03);
    border: 1px solid rgba(39, 41, 43, .1);
    padding-bottom: .75rem;
    padding-top: .75rem;
  }
}

The classes can be used together with utilities to create responsive floated images. Make sure to wrap the content in a .clearfix wrapper to clear the float if the text is shorter.

CoreUI for Angular

Notice the use of cCol md="6" directive. We're using it here to show the use of the clearfix class. We're adding quite a few meaningless phrases here to demonstrate how the columns interact here with the floated image.

As you can see the paragraphs gracefully wrap around the floated image. Now imagine how this would look with some actual content in here, rather than just this boring placeholder text that goes on and on, but actually conveys no tangible information at. It simply takes up space and should not really be read.

And yet, here you are, still persevering in reading this placeholder text, hoping for some more insights, or some hidden easter egg of content. A joke, perhaps. Unfortunately, there's none of that here.

<div class="clearfix">
  <img cCol md="6" class="float-md-end mb-3 ms-md-3" src="./assets/img/angular.jpg" alt="CoreUI for Angular" style="max-width: 100%;" />
  <p>
    Notice the use of <code>cCol md="6"</code> directive. We're using it here to show the use of the
    clearfix class. We're adding quite a few meaningless phrases here to
    demonstrate how the columns interact here with the floated image.
  </p>

  <p>
    As you can see the paragraphs gracefully wrap around the floated image. Now
    imagine how this would look with some actual content in here, rather than
    just this boring placeholder text that goes on and on, but actually conveys
    no tangible information at. It simply takes up space and should not really
    be read.
  </p>

  <p>
    And yet, here you are, still persevering in reading this placeholder text,
    hoping for some more insights, or some hidden easter egg of content. A joke,
    perhaps. Unfortunately, there's none of that here.
  </p>
</div>
import { Component } from '@angular/core';
import { ColDirective } from '@coreui/angular';

@Component({
  selector: 'docs-columns13',
  templateUrl: './columns13.component.html',
  standalone: true,
  imports: [ColDirective]
})
export class Columns13Component {}

API reference

Grid Module

import { GridModule } from '@coreui/angular';

@NgModule({
   imports: [GridModule,]
})
export class AppModule() { }

c-col cCol

component directive

Inputs
prop description type default notes
xs The number of columns on extra small devices (<576px). auto | number | boolean undefined
sm The number of columns on extra small devices (<768px). auto | number | boolean undefined
md The number of columns on extra small devices (<992px). auto | number | boolean undefined
lg The number of columns on extra small devices (<1200px). auto | number | boolean undefined
xl The number of columns on extra small devices (<1400px). auto | number | boolean undefined
xxl The number of columns on extra small devices (≥1400px). auto | number | boolean undefined
offset Offset grid columns number|{sm|md|lg|xl|xxl}:number undefined
order Controls the visual order of your columns. Includes support for 1 through 5 across all six grid tiers. "first"|"last"|number|{sm|md|lg|xl|xxl}:number undefined
  • GitHub
  • Twitter
  • Support
  • CoreUI (Vanilla)
  • CoreUI for React.js
  • CoreUI for Vue.js

CoreUI for Angular is Open Source UI Components Library for Angular.

Currently v5.5.1 Code licensed MIT , docs CC BY 3.0 .
CoreUI PRO requires a commercial license.