Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vertical spacing between Row. #4410

Closed
vijayst opened this issue Dec 29, 2016 · 25 comments
Closed

vertical spacing between Row. #4410

vijayst opened this issue Dec 29, 2016 · 25 comments

Comments

@vijayst
Copy link
Contributor

vijayst commented Dec 29, 2016

I want to have vertical spacing between Row, similar to gutter.

<Row gutter={8}></Row>

Something like vgutter will help.

<Row vgutter={8}></Row>
@afc163
Copy link
Member

afc163 commented Dec 29, 2016

Just <Row style={{ marginBottom: 8 }}></Row>.

@afc163 afc163 closed this as completed Dec 29, 2016
@KeionneDerousselle
Copy link

Wouldn't that mean the margin on the bottom isn't responsive the way gutter is? It would be nice to have something responsive.

@rjmarques
Copy link

I also think this feature request makes sense

@tigersaggy
Copy link

In my case, i wanted to reduce the default space between Rows, and marginBottom was not helpful (since it adds more space). So as a workaround for now, i have set height on column to make it work.
Example : <Col style={{ height: '40px' }} span={6}>

@ykzeng
Copy link

ykzeng commented Mar 21, 2019

Vote for the vgutter feature, it doesn't make sense to have gutter only on horizontal axis instead of both (horizontal and vertical)

@iancdma
Copy link

iancdma commented Apr 3, 2019

I think we need to have this feature in the next release. @afc163

@Songkeys
Copy link

+1. Any updates for this?

@filipjnc
Copy link

I think the request is misleading. What the grid system indeed misses is not a marginBottom between rows, but a gutter between (vertically) stacked columns inside a row.

@webberwang
Copy link

How come the issue has been closed? I think the use case is common

@redaelkhayat
Copy link

<Row style={{ margin: -16 }}>{columns.map(() => <Col ... style={{ padding: 16 }} />)}</Row>

@MihaiWill
Copy link

MihaiWill commented May 18, 2020

Also for List component...

export interface ListGridType {
    gutter?: number;
    **vgutter?: number;** <--- THIS
    column?: ColumnCount;
    xs?: ColumnCount;
    sm?: ColumnCount;
    md?: ColumnCount;
    lg?: ColumnCount;
    xl?: ColumnCount;
    xxl?: ColumnCount;
}

@vtrikoupis
Copy link

This should be considered fundamental.

@ttobollik
Copy link

I actually think [nzGutter]="[8,8]" will do the trick

@bluenote10
Copy link

Since the status of this issue is a bit confusing: It has been implemented in #18979 but slightly different then discussed above. This works now:

image

From the docs:

image

@rizwanliaqat97
Copy link

Since the status of this issue is a bit confusing: It has been implemented in #18979 but slightly different then discussed above. This works now:

image

From the docs:

image

Didn't work for me, I'm on antd 4.12.3 I'm using this array format to set vertical and horizontal gutter but it ignores the vertical one and just applies the horizontal. If I give a number as gutter value then too it's applied in horizontal direction only.

@rizwanliaqat97
Copy link

I can tell it was working... we upgraded to antd 4 recently and then another upgrade to its latest version. It just stopped working somewhere in between.

@dhriaznov
Copy link

Agree with @rizwanliaqat97 , having the same issue after update of antd

@ZhangChengX
Copy link

Didn't work on 4.12.3 either. It adds row-gap property but the row-gap only works in a grid layout.

@siowzhenhan
Copy link

Experiencing the same issue with vertical gutter as well after updating antd

@themavix
Copy link

having the same issue on 4.15.3

@AlexGraz
Copy link

AlexGraz commented Apr 30, 2021

Same issue on 4.15.3.
To mitigate it I've wrapped my Rows in a Space set to vertical.

<Space direction={'vertical'} size={SpaceSize}>
   <Row>
       <Col/>
   </Row>
   <Row>
       <Col/>
   </Row>
</Space>

@khanguslee
Copy link

Didn't work on 4.12.3 either.

having the same issue on 4.15.3

This issue is still occurring in 4.16.3

When will this get resolved?

@vsosinga
Copy link

vsosinga commented Aug 5, 2021

I ended up creating my own implementation of Row mimicking the old behaviour.
We don't use responsive gutters, so this only works with the [horizontal, vertical] gutter.

import "./Row.less";

import { Row as AntDRow } from "antd";
import { RowProps } from "antd/lib/grid";
import React from "react";

export const Row = ({
  gutter,
  ...props
}: RowProps): JSX.Element => (
  <AntDRow
    {...props}
    gutter={gutter}
    className="row"
    style={
      {
        "--row-margin": Array.isArray(gutter)
          ? `${(gutter[1] as number) / 2}px`
          : `${(gutter as number) / 2}px`
      } as React.CSSProperties
    }
  />
);

LESS:

.row {
  margin: calc(-1 * var(--row-margin)) 0px var(--row-margin);
  > .ant-col {
    padding: var(--row-margin);
  }
}

@robbash
Copy link

robbash commented Sep 10, 2021

I'm struggling here as well. However, for me it seems to work nicely (even having different values for horizontal and vertical) keeping all Cols in one Row and I just wanted to share it:

<Row gutter={[8,24]}>
  <Col span={6}>col</Col>
  <Col span={6}>col</Col>
  <Col span={6}>col</Col>
  <Col span={6}>col</Col>

  <Col span={6}>col</Col>
  <Col span={12}>col</Col>
  <Col span={6}>col</Col>

  <Col span={24}>col</Col>
</Row>

@FA5I
Copy link

FA5I commented Sep 17, 2021

Same as @robbash, I had multiple rows, but the vertical gutter was not working.

Moving everything into one row seems to have worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests