Marker
A note between messages: a status, a labeled divider, an action. In the look of the app's style.
Usage
import { Component, ViewEncapsulation } from '@angular/core';import { ScMarker, ScMarkerContent, ScMarkerIcon, ScSpinner,} from '@semantic-components/ui';import { SiGitBranchIcon, SiLoaderCircleIcon, SiSearchIcon,} from '@semantic-icons/lucide-icons';
@Component({ selector: 'app-marker-usage-demo', imports: [ ScMarker, ScMarkerIcon, ScMarkerContent, ScSpinner, SiGitBranchIcon, SiLoaderCircleIcon, SiSearchIcon, ], template: ` <div class="flex w-full max-w-sm flex-col gap-8 py-6"> <div scMarker> <span scMarkerIcon><svg siGitBranchIcon></svg></span> <span scMarkerContent>Switched to a new branch</span> </div> <div scMarker role="status"> <span scMarkerIcon ><svg scSpinner siLoaderCircleIcon aria-label="Thinking"></svg ></span> <span scMarkerContent class="shimmer motion-reduce:shimmer-none" >Thinking...</span > </div> <div scMarker variant="separator"> <span scMarkerContent>Conversation compacted</span> </div> <div scMarker> <span scMarkerIcon><svg siSearchIcon></svg></span> <span scMarkerContent>Explored 4 files</span> </div> </div> `, host: { class: 'flex w-full justify-center' }, encapsulation: ViewEncapsulation.None,})export class MarkerUsageDemo {}Anatomy
Every part is a directive on your element — a div, a link or a button; the icon and the words are yours.
import { ScMarker, ScMarkerIcon, ScMarkerContent } from '@semantic-components/ui';<div scMarker variant="…"> <span scMarkerIcon>…</span> <span scMarkerContent>…</span></div>Accessibility
- A marker is text by default. Streaming or in progress ("Thinking…", a running tool): role="status", so it is announced as it appears.
- A labeled divider needs no role: its lines are decorative. Not role="separator" — a separator is named by aria-label, its text unread.
- The icon is hidden: the content says it. A link or a button marker is named by its content.
Examples
Variants
import { Component, ViewEncapsulation } from '@angular/core';import { ScMarker, ScMarkerContent } from '@semantic-components/ui';
/** variant: default (inline notes), separator (a label between lines), border (a row with a line under it). */@Component({ selector: 'app-variants-marker-demo', imports: [ScMarker, ScMarkerContent], template: ` <div class="flex w-full max-w-sm flex-col gap-8 py-6"> <div scMarker>Status
import { Component, ViewEncapsulation } from '@angular/core';import { ScMarker, ScMarkerContent, ScMarkerIcon, ScSpinner,} from '@semantic-components/ui';import { SiLoaderCircleIcon } from '@semantic-icons/lucide-icons';
/** Something in progress: role="status", so it is announced as it appears; a spinner as its icon. */Shimmer
import { Component, ViewEncapsulation } from '@angular/core';import { ScMarker, ScMarkerContent } from '@semantic-components/ui';
/** Streaming text: the shimmer utility on the content — stopped when motion is reduced. */@Component({ selector: 'app-shimmer-marker-demo', imports: [ScMarker, ScMarkerContent], template: ` <div class="flex w-full max-w-sm flex-col gap-8 py-6"> <div scMarker role="status">Separator
import { Component, ViewEncapsulation } from '@angular/core';import { ScMarker, ScMarkerContent } from '@semantic-components/ui';
/** A labeled divider — a date, a section — in a conversation. No role="separator": its label would be lost. */@Component({ selector: 'app-separator-marker-demo', imports: [ScMarker, ScMarkerContent], template: ` <div class="flex w-full max-w-sm flex-col gap-8 py-6"> <div scMarker variant="separator">Border
import { Component, ViewEncapsulation } from '@angular/core';import { ScMarker, ScMarkerContent, ScMarkerIcon,} from '@semantic-components/ui';import { SiFileTextIcon, SiGitBranchIcon, SiSearchIcon,With icon
import { Component, ViewEncapsulation } from '@angular/core';import { ScMarker, ScMarkerContent, ScMarkerIcon,} from '@semantic-components/ui';import { SiBookOpenCheckIcon, SiGitBranchIcon, SiSearchIcon,Links and buttons
import { Component, ViewEncapsulation, signal } from '@angular/core';import { RouterLink } from '@angular/router';import { ScFrame, ScMarker, ScMarkerContent, ScMarkerIcon,} from '@semantic-components/ui';import { SiGitBranchIcon, SiRotateCcwIcon } from '@semantic-icons/lucide-icons';RTL
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import { ScMarker, ScMarkerContent, ScMarkerIcon,} from '@semantic-components/ui';import { SiGitBranchIcon, SiSearchIcon } from '@semantic-icons/lucide-icons';
/** In a right-to-left page: the icon on the right, the text after it. */API reference
Each part takes class, merged over the style (cn: a later class wins).
| Part | Selector | Description |
|---|---|---|
ScMarker | div[scMarker], a[scMarker], button[scMarker] | variant ('default', 'separator', 'border'). On a link or a button (type="button") it does what it says. |
ScMarkerIcon | span[scMarkerIcon] | Your icon, hidden from screen readers. |
ScMarkerContent | span[scMarkerContent] | The words; centered between the lines of a separator. |