Clay
Skip to ContentClayClay by Liferay
  • Get Started
    • Introduction
    • What is Clay
    • Importing the JS Component
    • Using JS Components with Metal.js
    • Web Components
  • Foundations
    • Grid
    • Typography
  • Lexicon Core Components
    • Alerts
    • Badges
    • Buttons
    • Cards
    • Charts
      • Advanced Examples
        • Axis Label
        • Axis Range
        • Data Color
        • Gridlines
        • Predictive forecasting
        • Regions
        • X Axis Tick Formatting
      • Basic Examples
        • Bar Chart
        • Bubble Chart
        • Combination Chart
        • Donut Chart
        • Gauge Chart
        • Geomap Chart
        • Line Chart
        • Pie Chart
        • Scatter Chart
        • Spline Chart
        • Step Chart
    • Dataset Display
    • Dropdown Menu
    • Forms
      • Checkbox, Radio, and Toggle
      • Forms
      • Forms Hierarchy
      • Forms Navigation
      • Multi Step Form
      • Multi Step Form Simplified
      • Selectors
      • Text Input
      • Text Input Group
      • Text Input Localizable
      • Text Input Variations
    • Icons
    • Labels
    • Link
    • List
    • Loading Indicator
    • Modals
    • Navigation
      • Breadcrumbs
      • Navigation Bar
      • Vertical Navigation
    • Pagination
    • Popovers and Tooltips
    • Progress Bars
    • Sidebar
      • Info Panel
    • Stickers
    • Table
      • Inline Edit Table
      • Table
    • Tabs
    • Toolbars
      • Management Toolbar
  • CSS Framework
    • SCSS
    • Class Helpers
    • Satellite Components
      • Alerts
      • Badges
      • Button Group
      • Cards
      • Dropdown Menu
      • Forms
        • Form Elements
        • Form Elements (Input Groups)
        • Form Elements (Validation)
      • Images (Aspect Ratios)
      • Images and Thumbnails
      • Labels
      • Links
      • List Groups
      • Modals
      • Nav
      • Navigation
        • Header
      • Paginations
      • Panels
      • Popovers and Tooltips
      • Progress Bars
      • Stickers
      • Tables
      • Tbar (Toolbar)
      • Timelines
      • Toggle Switch
    • Page Examples
      • Card View Template
      • Document Upload
      • List View Template
      • Table View Template
      • Users and Organizations
  • News

Cards

Horizontal Card with autofit-col-*

Use card-row with autofit-col-expand and autofit-col to create a number of custom horizontal cards. autofit-col-expand fills the remaining space, and autofit-col matches the width of its content.

<div class="card-row">
    <div class="autofit-col">
        <section class="autofit-section"></section>
    </div>
    <div class="autofit-col autofit-col-expand">
        <section class="autofit-section"></section>
    </div>
</div>
Fills remaining space.

The example below only uses two .autofit-cols.

<div class="card-row">
    <div class="autofit-col">
        <section class="autofit-section"></section>
    </div>
    <div class="autofit-col">
         <section class="autofit-section"></section>
    </div>
</div>
Only as wide as this text.

The example below only uses two .autofit-col-expands.

<div class="card-row">
    <div class="autofit-col autofit-col-expand">
        <section class="autofit-section"></section>
    </div>
    <div class="autofit-col autofit-col-expand">
        <section class="autofit-section"></section>
    </div>
</div>
This will split the space in half.

Padded Horizontal Cards

Nest a card-row element inside a card-body element to add some spacing around a horizontal card.

<div class="card-body">
    <div class="card-row"></div>
</div>
thumbnail

So ristretto cappuccino

Wings eu, pumpkin spice robusta.

Truncating Text Inside Card

Add the text-truncate class to text elements to truncate their text.

thumbnail

So ristretto cappuccino

Wings eu, pumpkin spice robusta, kopi-luwak mocha caffeine froth grounds.

  • ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual

    • Download
    • Edit
    • Move
    • Checkout
    • Permissions
    • Move to Recycle Bin
  • Folder 01

    • Download
    • Edit
    • Move
    • Checkout
    • Permissions
    • Move to Recycle Bin
  • Folder 02

    • Download
    • Edit
    • Move
    • Checkout
    • Permissions
    • Move to Recycle Bin
  • Folder 03

    • Download
    • Edit
    • Move
    • Checkout
    • Permissions
    • Move to Recycle Bin

Card Row Content Alignment Helpers

Vertically align content by setting justify-content to flex-start, center, or flex-end on autofit-col.

Horizontally align content by setting text-align to left, center, or right on autofit-col.

You can also use Bootstrap 4's helper classes justify-content-start, justify-content-center, or justify-content-end on card-row elements to align content in the row's columns.

top
middle
bottom
left
center
right

Add the autofit-col-gutters class to a card column to add gutters to it.

thumbnail

So ristretto cappuccino

Wings eu, pumpkin spice robusta.

Card Helper Classes

Use the rounded, rounded-circle, or rounded-0 classes on the card to quickly shape the borders.

autofit-col-expand
autofit-col-expand
thumbnail
autofit-col-expand
autofit-col-expand
autofit-col-expand

To style the border-radius to match the card's border-radius, add the card-item-first and card-item-last classes to elements that appear at the beginning or end of the card, respectively. These classes work similar to Bootstrap 4's .card-img-top and .card-img-bottom classes, but they also cover the left and right.

thumbnail

Joe Bloggs

Administrator

Wings eu, pumpkin spice robusta, kopi-luwak mocha caffeine froth grounds.

Space Program

Because you live life on the edge of space.

Card Dividers

Use `

` to create a horizontal division between content inside a card.

autofit-col-expand

Title

autofit-col-expand

Clickable Checkbox Card

To make the whole card clickable, Wrap the checkbox and card in the markup shown below:

Aldcott Gage George Polwarth-Kitchener

empty.jpg

Approved
  • Download
  • Edit
  • Move
  • Checkout
  • Permissions
  • Move to Recycle Bin
<div class="form-check form-check-card form-check-top-left">
    <label class="form-check-label">
        <input class="form-check-input" type="checkbox"/>
        <div class="card">...</div>
    </label>
</div>

Clickable Radio Card

To make the whole card clickable, wrap the radio input and card in the markup shown below:

<div class="form-check form-check-card form-check-top-left">
    <label class="form-check-label">
        <input class="form-check-input" type="radio"/>
        <div class="card">...</div>
    </label>
</div>

Checkbox Card

Follow the pattern below to add checkboxes to cards:

This pattern requires JavaScript to add and remove the active class when the input is checked/unchecked.
thumbnail PNG

Aldcott Gage George Polwarth-Kitchener

thumbnail_dock.jpg

Approved
  • Download
  • Edit
  • Move
  • Checkout
  • Permissions
  • Move to Recycle Bin

ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual

  • Download
  • Edit
  • Move
  • Checkout
  • Permissions
  • Move to Recycle Bin

ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual

  • Download
  • Edit
  • Move
  • Checkout
  • Permissions
  • Move to Recycle Bin
<div class="form-check form-check-card form-check-top-left">
    <label class="form-check-label">
        <input class="form-check-input" type="checkbox"/>
    </label>
    <div class="card">...</div>
</div>

Radio Card

Follow the pattern below to add radio inputs to cards:

This pattern requires JavaScript to add and remove the active class when the input is checked/unchecked.
thumbnail PNG

Aldcott Gage George Polwarth-Kitchener

thumbnail_dock.jpg

Approved
  • Download
  • Edit
  • Move
  • Checkout
  • Permissions
  • Move to Recycle Bin

ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual

  • Download
  • Edit
  • Move
  • Checkout
  • Permissions
  • Move to Recycle Bin

ReallySuperInsanelyJustIncrediblyLongAndTotallyNotPossibleWordButWeAreReallyTryingToCoverAllOurBasesHereJustInCaseSomeoneIsNutsAsPerUsual

  • Download
  • Edit
  • Move
  • Checkout
  • Permissions
  • Move to Recycle Bin
<div class="form-check form-check-card form-check-top-left">
    <label class="form-check-label">
        <input class="form-check-input" type="radio"/>
    </label>
    <div class="card">...</div>
</div>

Except as otherwise noted, the content of this site is licensed under CC BY-SA 4.0 license.