Skip to content

Cards

The card is a flexible container used to group related content in a bounded section. It can hold text, images, and actions.

Use the .ro-card class as the main container. You can nest elements like .ro-card-header, .ro-card-body, and .ro-card-footer to structure your content.

<div class="ro-card">
<div class="ro-card-header">
<h4>Card Title</h4>
</div>
<div class="ro-card-body">
<p>
This is the card body.
It contains the main content.
</p>
</div>
<div class="ro-card-footer">
<button class="ro-btn">Action</button>
</div>
</div>
Preview

Card Title

This is the card body. It contains the main content.

Add the .ro-clickable class to provide visual feedback on hover, indicating the card can be interacted with.

<div class="ro-card ro-clickable">
<div class="ro-card-body">
<h4>Clickable Card</h4>
<p>
Hover over me to see the shadow effect.
</p>
</div>
</div>
Preview

Clickable Card

Hover over me to see the shadow effect.

Use the .ro-card-btn class to place a floating action button at the top-right corner of the card. This is typically used for contextual actions.

<div class="ro-card ro-clickable ro-border">
<button class="ro-btn ro-card-btn ro-shape-icon ro-size-sm">
<i class="ro-icon ro-icon-dot-vertical"></i>
</button>
<div class="ro-card-body">
<h4>Card with Action</h4>
<p>
This card has a floating action button.
</p>
</div>
</div>
Preview

Card with Action

This card has a floating action button.

Combine .ro-border with a color class like .ro-border-product to add a colored border.

<div class="ro-stack">
<div class="ro-card ro-border ro-border-product">
<div class="ro-card-body">
Card with a product border
</div>
</div>
<div class="ro-card ro-border ro-border-danger">
<div class="ro-card-body">
Card with a danger border
</div>
</div>
</div>
Preview
Card with a product border
Card with a danger border

Apply a colored shadow effect using .ro-shadow-* classes. These are often used on clickable cards to enhance the hover effect.

<div class="ro-stack">
<div class="ro-card ro-clickable ro-shadow-product">
<div class="ro-card-body">
Card with a product shadow
</div>
</div>
<div class="ro-card ro-clickable ro-shadow-info">
<div class="ro-card-body">
Card with a info shadow
</div>
</div>
<div class="ro-card ro-clickable ro-shadow-success">
<div class="ro-card-body">
Card with a success shadow
</div>
</div>
<div class="ro-card ro-clickable ro-shadow-warning">
<div class="ro-card-body">
Card with a warning shadow
</div>
</div>
<div class="ro-card ro-clickable ro-shadow-danger">
<div class="ro-card-body">
Card with a danger shadow
</div>
</div>
</div>
Preview
Card with a product shadow
Card with a info shadow
Card with a success shadow
Card with a warning shadow
Card with a danger shadow

Images can be added using the .ro-card-img class. The image will automatically adapt its dimensions based on the card’s orientation.

<div class="ro-card ro-border">
<img
class="ro-card-img"
src="https://placehold.co/200x100"
alt="Sample image"
width="200"
height="100"
/>
<div class="ro-card-body">
<h4>Card with Image</h4>
<p>Images automatically adapt to the card layout.</p>
</div>
</div>
<div class="ro-card ro-border ro-dir-horizontal">
<img
class="ro-card-img"
src="https://placehold.co/200x100"
alt="Sample image"
width="200"
height="100"
/>
<div class="ro-card-body">
<h4>Horizontal Card with Image</h4>
<p>The image adjusts its height to match the card when in horizontal layout.</p>
</div>
</div>
Preview
Sample image

Card with Image

Images automatically adapt to the card layout.

Sample image

Horizontal Card with Image

The image adjusts its height to match the card when in horizontal layout.

Card variants are controlled via utility classes.

Modifier ClassDefault ValueDescription
.ro-dir-horizontalcolumnAligns the card’s children on a horizontal axis (row).
.ro-padding-*md (--ro-size-5)Modifies the internal spacing (padding). Options: 0, xs, sm, lg, xl.
.ro-gap-*4 (--ro-size-4)Adjusts the gap between child elements. Options: 0 to 6.
.ro-clickable(none)Adds a “pointer” cursor and a hover shadow to indicate the card is clickable.
.ro-card-btn(none)Styles a button as a top-right floating action inside the card.
.ro-bordernoneAdds a 1px border to the card.
.ro-border-*(none)Modifies the border color. Options: product, product-light, danger. Deprecated: info, success, warning.
.ro-shadow-*noneApplies a predefined shadow. Options: product, info, success, warning, danger.
.ro-bg-*(none)Changes the background color. Options: product, info, success, warning, danger, grey-light, grey-dark, translucent.
.ro-radius-*mdModifies border radius. Options: sm, lg, xl.
.ro-align-*initialAligns card content. Options: start, center, end.
.ro-nowrapwrapPrevents card content from wrapping.

The .ro-card-header and .ro-card-footer sections support additional alignment classes:

Modifier ClassDefault ValueDescription
.ro-justify-*space-betweenControls horizontal alignment. Options: start, center, end.
.ro-align-*centerControls vertical alignment. Options: start, center, end.

When using images in cards:

Modifier ClassDefault ValueDescription
.ro-card-img(none)Base class for card images.
.ro-img-radius-0Inherits card radiusRemoves border radius from the image.