Skip to content
Focsd homeFocsd homeFocsd
Forms

Source chip

A numbered link to a source, with the host name beside it.

  • Tag: focsd-source-chip
  • Pattern: Link
  • Category: AI

Example

HTML
<focsd-source-chip
href="https://www.w3.org/WAI/ARIA/apg/patterns/feed/"
label="Feed pattern"
index="1"></focsd-source-chip>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/ai';
</script>
<focsd-source-chip href="https://www.w3.org/WAI/ARIA/apg/patterns/feed/" label="Feed pattern" index="1"></focsd-source-chip>

API

Attributes

AttributePropertyTypeDefault
hrefhrefstring—
labellabelstring—
indexindexnumber0

CSS parts

Style the inside of the component with ::part(), for example focsd-source-chip::part(link).

PartDescription
linkThe link (a plain span when the URL is not allowed).
indexThe "[n]" number.
hostThe host name.

Accessibility

  • A real link named "[1] Feed pattern", underlined, with the host name in muted text.
  • Only https:, http:, mailto: and relative URLs become links. Any other scheme (javascript:, data:) is shown as text, not a link. Links get rel="noopener noreferrer nofollow" and never set target.

Keyboard

KeyAction
EnterFollow the link