An inline chip that attributes a statement to its source, with an optional number, site icon and hover preview.
<tp-citation>
Citation
Default density
Compact density
Restart from the initial state
Show the copyable source
Tidal turbines generate on a timetable set by the moon
energy.example,
so grid operators can plan storage weeks in advance
Grid storage notes.
Tidal turbines generate on a timetable set by the moon
energy.example,
so grid operators can plan storage weeks in advance
Grid storage notes.
<p style="max-inline-size:34rem;margin:0 auto;line-height:1.75">
Tidal turbines generate on a timetable set by the moon
<tp-citation href="https://energy.example/tidal" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22%2316a34a%22%2F%3E%3Ctext%20x%3D%228%22%20y%3D%2211.5%22%20font-family%3D%22system-ui%2Csans-serif%22%20font-size%3D%2210%22%20font-weight%3D%22700%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3EE%3C%2Ftext%3E%3C%2Fsvg%3E">energy.example</tp-citation>,
so grid operators can plan storage weeks in advance
<tp-citation href="https://northwind.example/grid-storage" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22%232563eb%22%2F%3E%3Ctext%20x%3D%228%22%20y%3D%2211.5%22%20font-family%3D%22system-ui%2Csans-serif%22%20font-size%3D%2210%22%20font-weight%3D%22700%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3EN%3C%2Ftext%3E%3C%2Fsvg%3E">Grid storage notes</tp-citation>.
</p>
Usage
A Citation sits in running text after the statement it supports. Its label names the source, and with an href it is a link to it. Use one style per passage: labelled chips like the one above, or numbered markers that point to a Citation list. A number and a label can be combined in one citation, but mixing both styles in a passage makes it harder to scan.
Labels and icons
The default slot is the label, such as a site name or a source title; long labels end in an ellipsis. src adds a site icon, which keeps its space while it loads. Without src, or when the image fails, the icon slot is used, else a generic web mark. Put a tp-icon in the icon slot to show an icon without an image.
Labels and icons
Default density
Compact density
Restart from the initial state
Show the copyable source
energy.example
Coastal survey 2025
Grid storage notesInterview with the site engineer
energy.example
Coastal survey 2025
Grid storage notesInterview with the site engineer
A site address, one that starts with http:// or https://, opens in a new tab unless you set target. While a labelled site citation is hovered or focused, an external-link mark fades in over the end of the label without changing its width, so the surrounding text never moves. Without an accepted href the citation is plain text and takes no tab stop. Relative addresses, #fragment addresses and http, https, mailto and tel addresses are accepted. Any other address, or no address, renders plain text that is not focusable, unless a preview needs a focus target.
Source preview
A description adds a preview card that opens after a short hover or on keyboard focus. It shows the site icon, the host, source-title and the description. Use source-title for the full title when the label is only the site name. The preview slot takes extra content for the card.
Source preview
Default density
Compact density
Restart from the initial state
Show the copyable source
Turbine blades now last about twenty years underwater
energy.example.
Turbine blades now last about twenty years underwater
energy.example.
<p style="max-inline-size:34rem;margin:0 auto;line-height:1.75">
Turbine blades now last about twenty years underwater
<tp-citation
href="https://energy.example/tidal"
src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22%2316a34a%22%2F%3E%3Ctext%20x%3D%228%22%20y%3D%2211.5%22%20font-family%3D%22system-ui%2Csans-serif%22%20font-size%3D%2210%22%20font-weight%3D%22700%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3EE%3C%2Ftext%3E%3C%2Fsvg%3E"
source-title="Blade wear in fast tidal streams"
description="Ten-year inspection results from three test sites, with corrosion and fatigue measurements."
>energy.example</tp-citation>.
</p>
The preview is supplementary. The citation still activates its link normally, and the destination page should carry everything a reader needs.
Numbered references
For footnote-style references, list the sources in a tp-citation-list and point to them from the text. The list numbers its entries in document order from start. An in-text citation names an entry by its id with source and takes its number, address, title and preview from it, so an empty source citation renders as a plain number. superscript raises it like a footnote marker. A citation that shows only a number is a compact round chip; with a label, the number leads the chip. A citation that shows only a number keeps a small space from the word it follows, so markers can be written directly after the word.
Numbered references
Default density
Compact density
Restart from the initial state
Show the copyable source
Output is predictable
and storage needs stay small,
though flow varies with the season.
Blade wear in fast tidal streamsGrid storage notesCoastal survey 2025
Output is predictable
and storage needs stay small,
though flow varies with the season.
Blade wear in fast tidal streamsGrid storage notesCoastal survey 2025
<article style="display:grid;gap:var(--tp-space-4);max-inline-size:34rem;margin-inline:auto;inline-size:100%">
<p style="margin:0;line-height:1.75">
Output is predictable<tp-citation source="tidal-1" href="#tidal-1" superscript></tp-citation>
and storage needs stay small<tp-citation source="tidal-2" href="#tidal-2" superscript></tp-citation>,
though flow varies with the season<tp-citation source="tidal-3" href="#tidal-3" superscript></tp-citation>.
</p>
<tp-citation-list label="Sources">
<tp-citation id="tidal-1" href="https://energy.example/tidal" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22%2316a34a%22%2F%3E%3Ctext%20x%3D%228%22%20y%3D%2211.5%22%20font-family%3D%22system-ui%2Csans-serif%22%20font-size%3D%2210%22%20font-weight%3D%22700%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3EE%3C%2Ftext%3E%3C%2Fsvg%3E" description="Ten-year inspection results from three test sites.">Blade wear in fast tidal streams</tp-citation>
<tp-citation id="tidal-2" href="https://northwind.example/grid-storage" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22%232563eb%22%2F%3E%3Ctext%20x%3D%228%22%20y%3D%2211.5%22%20font-family%3D%22system-ui%2Csans-serif%22%20font-size%3D%2210%22%20font-weight%3D%22700%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3EN%3C%2Ftext%3E%3C%2Fsvg%3E" description="How predictable generation reduces battery sizing.">Grid storage notes</tp-citation>
<tp-citation id="tidal-3" href="https://marine.example/survey" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20rx%3D%224%22%20fill%3D%22%23d97706%22%2F%3E%3Ctext%20x%3D%228%22%20y%3D%2211.5%22%20font-family%3D%22system-ui%2Csans-serif%22%20font-size%3D%2210%22%20font-weight%3D%22700%22%20text-anchor%3D%22middle%22%20fill%3D%22white%22%3EM%3C%2Ftext%3E%3C%2Fsvg%3E" description="Seasonal flow records for estuary sites.">Coastal survey 2025</tp-citation>
</tp-citation-list>
</article>
Give each marker its entry’s fragment as href, as above: activating the marker moves focus to the entry, and the entry opens the site. Without its own href, a marker links straight to the source. Editing an entry updates every citation that names it.
List layout
orientation="horizontal" lets the entries wrap in rows, which suits a compact source strip under a generated answer. Set index on a citation to override its position.
Horizontal list
Default density
Compact density
Restart from the initial state
Show the copyable source
Citations use the Badge treatments through variant. The default outline is a border with muted text, so it reads below the surrounding copy; switch only when a citation needs more or less weight than the text around it.
Variants
Default density
Compact density
Restart from the initial state
Show the copyable source
A citation’s accessible name is the citation word, its number and its label, else its source title, else the address host, for example “Citation 1: Blade wear in fast tidal streams”. When the link opens in a new tab, the name ends with “(opens in a new tab)”. Numbers follow the locale of the nearest lang. A plain citation is announced as a note with the same name. The preview is supplementary: its text describes the citation without replacing its name, and the destination page must carry everything a reader needs. The list is announced as a list named by label.
API Reference
Every element also accepts motion-policy.
Attributes
AttributePropertyTypeDefaultDescriptionid———Names the citation, so that others repeat its values by naming it in source.hrefhrefstring | nullnullThe source's address; a web address the citation accepts makes it a link.targettargetstring | nullnullWhere the link opens; links to other sites open in a new tab unless this is set.relrelstring | nullnullThe link's relationship to the page, as on a native link.indexindexnumber | nullnullThe source's number; inside a Citation list, entries are numbered in order unless they set it.srcsrcstring''The URL of the source's mark, such as a site icon; the icon slot or a globe shows when it is unset or fails.source-titlesourceTitlestring''The source's title in the preview.descriptiondescriptionstring''A summary of the source; with it, the citation shows a preview on hover and focus.sourcesourcestring''The id of another citation whose values this one takes where its own are unset.superscriptsuperscriptbooleanfalseRaises the citation like a footnote marker, without growing the line.variantvariantCitationVariant'outline'The badge's treatment.
Properties
PropertyTypeDefaultDescriptionmessagesCitationMessages{}Replacements for the text of the accessible name; missing entries keep the defaults.resolvedSourceread-onlyCitationSourceValues—The values this citation presents, after taking unset ones from its source.
Methods
MethodReturnsDescriptionfocus(options?)voidFocuses the citation's link.
Slots
SlotDescriptiondefaultVisible label, such as the source site or title.iconSource mark used when src is unset or fails, such as a tp-icon.previewExtra preview content.
CSS parts
PartDescription::part(citation-badge)The composed Badge.::part(citation-index)The number.::part(citation-icon)The source mark.::part(citation-label)The label.::part(citation-external)The external-link mark over the end of a site link's label.::part(citation-preview)The composed Preview card.::part(citation-preview-source)Preview row with the source mark and host.::part(citation-preview-title)Preview title.::part(citation-preview-description)Preview description.
<tp-citation-list>
Attributes
AttributePropertyTypeDefaultDescriptionlabellabelstring''The list's accessible name, "Sources" by default.startstartnumber1The number of the first entry.
Properties
PropertyTypeDefaultDescriptionmessagesCitationListMessages{}Replacements for the built-in text; missing entries keep the defaults.