Skip to content
weftGitHub

CommentAnchor

The highlighted words a comment thread hangs from.

SourcePackage @weft-js/warp

Preview

tsx
import { state } from '@weft-js/core'import { CommentAnchor, Stack, Text } from '@weft-js/warp'export function CommentAnchorText() {  const active = state<string | null>(null)  return (    <Stack gap="related">      <Text>The cache keeps a page for <CommentAnchor thread="c-timeouts" active={active}>60 seconds</CommentAnchor> after a deploy.</Text>      <Text subtle>{active.value ? 'The thread is active.' : 'Press the highlighted words.'}</Text>    </Stack>  )}

Installation

npm install @weft-js/warp

Usage

tsx
import { CommentAnchor } from '@weft-js/warp'

Accessibility

Enter
Opens its thread
Space
Opens its thread

API Reference

PropTypeDefaultDescription
threadstring—The thread's id.
activeState<string | null>—The open thread, shared with the CommentRail.
childrenunknown—What it contains.

RelatedComment railComment thread