NSW Design System

NSW Design System defines cards as a high-level summary of content related to a single topic for users to navigate to.

Cards group information into meaningful sections, providing concise information in a condensed space to allow users to distinguish between content and find information easily. The information in a card outlines the main idea of a product, service, or piece of information, allowing a user to click through for further information.

Because it, card does not have a footer with actions. Instead, the whole card works as a link. The footer argument of the card is ignored and href argument must be used to specify card's link

Cards have 4 variants: standard card without specific variant, dark, light, and highlight

{%- call ui.util.call(show_example) -%} {%- raw %} {% call ui.util.call(ui.grid) -%} {%- call ui.util.call(ui.row, wrap=true, gap="lg") -%} {%- call ui.util.call(ui.column, span={"xs": 6}) -%} {{ ui.card(lipsum(1), title="Standard", href="") }} {%- endcall %} {%- call ui.util.call(ui.column, span={"xs": 6}) -%} {{ ui.card(lipsum(1), title="Dark", href="", variant="dark") }} {%- endcall %} {%- call ui.util.call(ui.column, span={"xs": 6}) -%} {{ ui.card(lipsum(1), title="Light", href="", variant="light") }} {%- endcall %} {%- call ui.util.call(ui.column, span={"xs": 6}) -%} {{ ui.card(lipsum(1), title="Highlight", href="", variant="highlight") }} {%- endcall %} {%- endcall %} {%- endcall %} {%- endraw %} {%- endcall %}

Cards support tag and date parameters to enrich the output. Tags can be used to specify categories applied to the card as a plain text. Date adds temporal information to the card and its recommended to use datetime component for it.

{%- call ui.util.call(show_example) -%} {%- raw %} {{ ui.card(lipsum(1), title="Rich card", tag="Hello, World", date=ui.datetime(ui.util.now())) }} {%- endraw %} {%- endcall %}

Cards can be rendered horizontally using horizontal parameter.

{%- call ui.util.call(show_example) -%} {%- raw %} {{ ui.card(lipsum(1), title="Horizontal card", img="https://placehold.co/100x100", horizontal=true) }} {%- endraw %} {%- endcall %}