Space

Set components spacing.

When To Use#

Avoid components clinging together and set a unified space.

import { NzSpaceModule } from 'ng-zorro-antd/space';

Examples

Crowded components horizontal spacing.

expand codeexpand code
Loading...
Card

Card content

Card content

Card

Card content

Card content

Crowded components vertical spacing.

expand codeexpand code
Loading...

large, middle and small preset sizes.

Set the nzSize to large and middle by setting size to large and middle respectively. If size is not set, the spacing is small.

expand codeexpand code
Loading...
center
Block
start
Block
end
Block
baseline
Block

Config item align.

expand codeexpand code
Loading...

Custom spacing size.

expand codeexpand code
Loading...

Crowded components split.

expand codeexpand code
Loading...

API#

nz-space#

PropertyDescriptionTypeDefaultGlobal Config
[nzSize]The space size'small' | 'middle' | 'large' | numbersmall
[nzDirection]The space direction'vertical' | 'horizontal'horizontal
[nzAlign]Align items'start' | 'end' | 'baseline' | 'center'-
[nzWrap]Auto wrap line, when horizontal effectivebooleanfalse
[nzSplit]Set splitTemplateRef-