Skip to content

Card Columns: responsive equal-width columns

Reference · Intermediate · Bootstrap 5

Arrange cards in a responsive row of one, two or three columns.

Arrange cards in a responsive row of one, two or three columns.

  • A Bootstrap 5 page. Include its JavaScript for Bootstrap dropdown, collapse, modal or offcanvas interactions.

Despite the inherited Card Columns name, this Bootstrap 5 template uses row-cols-1, row-cols-md-2 and row-cols-xl-3 with g-4. It is a regular row grid, not a masonry layout. Place cards inside column wrappers so gutters work.

Name Description
IDSets this element’s unique page identifier. Use a stable name such as projectSummary when another control, label or anchor must target it. Do not duplicate a static ID inside repeated markup; a component binding name and a form field’s submitted Name serve different purposes.
ClassEdits the element’s space-separated CSS class list. For example, add a project-defined class such as project-summary only when your stylesheet defines it. Preserve classes required by the component. A class name alone does not create CSS, load an extension or implement an event handler.
Name Description
Hide onHides the element at selected viewport ranges by adding responsive display utilities. For example, hiding below MD produces d-none with a restoring display class at MD. The control uses the component’s normal display type when restoring it. This hides layout and content visually; it does not protect private data or stop a server endpoint being called. Options: Hide on mobile (xs), Hide on landscape mobile (sm), Hide on tablet (md), Hide on laptop (lg), Hide on desktop (xl), Hide on extra wide (xxl).
PrintControls whether this element appears in printed output. Hide writes d-print-none. Show restores the component’s display type for print, such as d-print-block or d-print-table-row. For example, hide a navigation bar when printing a report. Check browser print preview because screen layout alone does not show this setting. Options: Show (d-print-block), Hide (d-print-none).
Visually HiddenAdds visually-hidden: content remains available to assistive technologies while it is visually clipped. Use it for an accessible label that should not appear on screen, not for hiding private data. It is different from display:none, which also removes the element from layout and generally from the accessibility tree. Default: off.
FocusableAdds visually-hidden-focusable, which hides the element until it or a descendant receives focus. A skip link is a typical example. The element must already be focusable, such as an anchor with href; this class does not add keyboard focusability. Do not combine it with an unconditional visually-hidden class, which would keep it hidden even when focused. Default: off.

Add three col wrappers, each containing one card. Verify one column on a narrow page, two from MD and three from XL; card reading order remains the source order.

Use the related guide for the full layout or component workflow.

You can place the component in its required parent, edit its actual children and verify the intended layout or interaction.