MCPcopy Create free account
hub / github.com/adobe/react-spectrum / anchorId

Function anchorId

packages/dev/s2-docs/src/typography.tsx:26–31  ·  view source on GitHub ↗
(children: ReactNode)

Source from the content-addressed store, hash-verified

24}
25
26function anchorId(children: ReactNode) {
27 return childrenToString(children)
28 .replace(/\s/g, '-')
29 .replace(/[^a-zA-Z0-9-_]/g, '')
30 .toLowerCase();
31}
32
33function AnchorLink({anchorId, isHovered, level, headingText}) {
34 let {isFocusVisible, focusProps} = useFocusRing({within: true});

Callers 3

H2Function · 0.70
H3Function · 0.70
H4Function · 0.70

Calls 1

childrenToStringFunction · 0.85

Tested by

no test coverage detected