Cards

A card serves as an overview and entry point for more detailed information and can offer direct access to the most important actions of an item.

The Kirigami types AbstractCardarrow-up-right and Cardarrow-up-right are used to implement the popular card component used on many mobile and web platforms. Cards can be used to display a collection of information or actions in an attractive and distinctive way.

Kirigami also offers 3 kinds of viewsarrow-up-right and positionersarrow-up-right to aid you in presenting your cards with beautiful and responsive layouts.

AbstractCard

A Kirigami.AbstractCardarrow-up-right is the simplest type of card. It's just a rectangle with a shadow, which can contain any Itemarrow-up-right in it. It can also have Items assigned to its headerarrow-up-right or footerarrow-up-right properties. In this case a Kirigami.Headingarrow-up-right is its header and a Controls.Labelarrow-up-right is the card's contentItemarrow-up-right.

Kirigami.AbstractCard {
    Layout.fillHeight: true
    header: Kirigami.Heading {
        text: qsTr("AbstractCard")
        level: 2
    }
    contentItem: Controls.Label {
        wrapMode: Text.WordWrap
        text: "..."
    }
}
Screenshot of an Abstract Card, a simple rectangular button with left-aligned text

Card

A Kirigami.Cardarrow-up-right inherits from AbstractCardarrow-up-right and provides more features out of the box. Cards inherit the same headerarrow-up-right and footerarrow-up-right from an Abstract Card, but you are encouraged to use a bannerarrow-up-right and a set of Kirigami.Actionarrow-up-right in the actions group instead.

Screenshot of a full-fledged Card with a banner background behind its title, white background behind its text, and two actions with icons and a hamburger menu at the bottom

CardsLayout

A Kirigami.CardsLayoutarrow-up-right is most useful when the cards being presented are either not instantiated by a model or are instantiated by a model that always has very few items. They are presented as a grid of two columns which will remain centered if the application is really wide, or become a single column if there is not enough space for two columns, such as a mobile phone screen.

circle-info

Note

CardsListViewarrow-up-right is better suited for larger models.

circle-exclamation

A card can optionally be oriented horizontally. In this case it will be wider than tall, and is better suited to being placed in a ColumnLayoutarrow-up-right. If you must put it in a CardsLayoutarrow-up-right, it will have a maximumColumnsarrow-up-right of 2 by default.

Screenshot of a CardsLayout showing two side by side cards in portrait orientation on top of a card in landscape orientation, all with different components being used

CardsListView

A Kirigami.CardsListViewarrow-up-right is a list view that can be used with AbstractCardarrow-up-right components.

A CardsListViewarrow-up-right will stretch child cards to its own width. This component should therefore only be used with cards which will look good at any horizontal size. Use of a Cardarrow-up-right component inside it is discouraged, unless it has Qt.Horizontalarrow-up-right as its headerOrientationarrow-up-right property.

The choice between using this view with AbstractCardarrow-up-right components or a conventional ListViewarrow-up-right with AbstractListItemarrow-up-right/BasicListItemarrow-up-right components is purely an aesthetic one.

Screenshot of a CardsListView, which is a simple vertical list of cards in landscape mode

Last updated