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/warpUsage
tsx
import { CommentAnchor } from '@weft-js/warp'Accessibility
- Enter
- Opens its thread
- Space
- Opens its thread
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
thread | string | — | The thread's id. |
active | State<string | null> | — | The open thread, shared with the CommentRail. |
children | unknown | — | What it contains. |
RelatedComment railComment thread