Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@klippa/ngx-grid

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@klippa/ngx-grid

## Usage To use the grid system, first import it into your angular module:

  • 14.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Klippa Grid Framework

Usage

To use the grid system, first import it into your angular module:

import {NgModule} from '@angular/core';
import {NgxGridModule} from '@klippa/ngx-grid';

@NgModule({
	imports: [ NgxGridModule ],
	declarations: [ MyComponent ],
	exports: [ MyComponent ],
})
export class MyModule {}

Then use the components in the template:

<klp-grid-container>
	<klp-grid-row>
		<klp-grid-column>
			<!-- ... -->
		</klp-grid-column>
	</klp-grid-row>
</klp-grid-container>

Breakpoints

Breakpointscreen widthmax container width
xs0px100%
sm576px540px
md768px720px
lg992px960px
xl1200px1140px
xxl1440px1380px

<klp-grid-container>

Grid containers cannot be nested at any level. Ideally, stick a grid container at the highest level in your application as possible and forget about it.

It can optionally take two inputs: fluid and gutter.

<klp-grid-container [fluid]="true" [gutter]="30">

fluid is false by default, in which case the grid container has a maximum width set for each breakpoint as defined in the breakpoint section.

If fluid is true, no max width will be set and the grid container will completely fill its parent.

gutter describes the gaps between columns in pixels

<klp-grid-row>

Grid rows must have a parent container at some level. Their direct children can only be grid columns. Any other child will throw an error.

<klp-grid-column>

Grid columns must be a direct child of a row. Any other parent will throw an error.

They can have two optional inputs, [width] and [offset].

Columns that overflow off the end of the row will be wrapped onto a new row.

[width]

The width input is used for setting the width of each column at each breakpoint. It takes an object with the breakpoint labels as keys and column widths ranging from 0 to 12 as values. Each row is 12 columns wide, so a column with a width of 6 will take up half the width of the row.

For example:

<klp-grid-column [width]="{ xs: 12, sm: 8, lg: 6 }">

If the breakpoint is set to 0, it is not rendered. Otherwise, it will use the width of the last specified breakpoint. So in the example width, it will be 12 wide on all screens smaller than sm, 8 wide for screens wider than sm but smaller than lg (that includes md), then finally 6 wide for all screens wider than lg.

[offset]

The offset input takes an object of breakpoints much the same way as [width], the only notable difference is that the offset values must be between 1 and 11. 0 and 12 will be ignored. offset adds "ghost" columns before a column.

For example:

<klp-grid-column [width]="{ xs: 4 }"></klp-grid-column>
<klp-grid-column [width]="{ xs: 4 }" [offset]="{ xs: 4 }"></klp-grid-column>

Will produce two columns that are 1/3 of the containing row, with a 1/3 gap between them.

FAQs

Package last updated on 26 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc