question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suppress `col` className in `Col` component

See original GitHub issue

Issue description

  • components: Col
  • reactstrap version #5.0.0-alpha.4
  • bootstrap version #4.0.0-beta.2

What is happening?

Sometimes it’s not desirable to have a column element having the class col. For example, one might want to reproduce the Stacked to horizontal example from Bootstrap’s documentation.

In my specific case, I wan my columns to have only the class col-md-4. If I use <Col md='4'>My content</Col> the resulting HTML element will have the class col col-md-4. By looking into Col’s source code, I found out that I can get rid of the col class by setting xs={false} md='4', but I believe that’s not the correct way of doing it (right?).

I think it would be nice to have an “intended” way of suppressing the col class name.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
pravdomilcommented, Feb 16, 2018

Yes, that’s what I would expect from Col.

<Col md={6}> should create <div class="col-md-6">

<Col md={6} xs> should create <div class="col col-md-6">

<Col> should create <div class="col">

Does it makes sense for everybody?

1reaction
TheSharpieOnecommented, Feb 16, 2018

col is in bootstrap’s documentation and features things like <div class="col col-lg-2"> (showing col in conjuction with a col-breakpoint value) I’m fine with making this change if everyone thinks it is the right thing to do. Breaking changes don’t matter, we have semvar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to hide Columns on a layout screen size on react ...
I tried: <Col xs="0"></Col> and similar but that did not work. Does anyone know how to hide a react-bootstrap Column? react-bootstrap.
Read more >
React-Bootstrap Container, Row and Col Component
It is used when we want to display data in the form of rows. Col Component provides a way to represent a column...
Read more >
CSS · Bootstrap
Using a single set of .col-md-* grid classes, you can create a basic grid system that starts out stacked on mobile devices and...
Read more >
Form Control - React-Bootstrap
Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized...
Read more >
Grid Column Start / End - Tailwind CSS
Use the col-span-{n} utilities to make an element span n columns. 01. 02. 03. 04. 05. 06. 07.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found