Skip to main content
Version: v9.0.0

ontario-summary-list-item

Use ontario-summary-list-item as a child inside ontario-summary-list to render a single key/value row.

Usage guidance

Please refer to the Ontario Design System for current documentation guidance for summary lists.

Configuration

After installing the component package, nest ontario-summary-list-item directly inside an ontario-summary-list. Each item renders a labelled key (name) and its corresponding value (description).

To add a row-level change link, either:

  • pass actionLink with at least an href to have the component generate the visible label and screen-reader text, or
  • use the action slot when a router-aware link is required, such as Next.js Link or Angular routerLink.

Use the compact prop to apply reduced row padding when a denser layout is needed.

Examples

Basic usage with name and description.

<ontario-summary-list caption="Personal information" heading-level="h3">
<ontario-summary-list-item name="Last name" description="Smith"></ontario-summary-list-item>
<ontario-summary-list-item name="First name" description="George"></ontario-summary-list-item>
</ontario-summary-list>

Row-level change link using actionLink.

<ontario-summary-list caption="Personal information" heading-level="h3">
<ontario-summary-list-item
name="Last name"
description="Smith"
action-link='{"href":"/step/personal-info"}'
></ontario-summary-list-item>
</ontario-summary-list>

Slot override pattern. Use the action slot when a router-aware link is required. Supply screen-reader text manually inside the slotted element.

<OntarioSummaryList caption="Personal information" headingLevel="h3">
<OntarioSummaryListItem name="Last name" description="Smith">
<Link slot="action" href="/step/personal-info">
Change
<span className="ontario-show-for-sr">
your answer for: <q>Last name</q>
</span>
</Link>
</OntarioSummaryListItem>
</OntarioSummaryList>

Overview

Ontario Summary List Item renders a single key/value row inside an ontario-summary-list.

For component guidance, see:

Properties

PropertyAttributeDescriptionTypeDefault
actionLinkaction-linkRenders a row-level change link. Accepts a JSON string (for plain HTML) or an object (for JSX/framework use). href is required; label overrides the visible link text (defaults to the i18n "Change" / "Modifier" label). Screen-reader text is always auto-generated from name. Use the action slot instead when a router-aware link is needed. The slot takes precedence over this prop when both are present.SummaryListActionLink | string | undefinedundefined
compactcompactWhen true, applies reduced row padding via the .compact modifier class.boolean | undefinedundefined
description (required)descriptionThe value/response rendered as <dd>. This prop is required.stringundefined
languagelanguageThe language of the component. Defaults to English via validateLanguage. Set automatically through event listeners from the header by default."en" | "fr" | undefinedundefined
name (required)nameThe key/question label rendered as <dt>. This prop is required.stringundefined

Built with StencilJS