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

Function Tag

starters/docs/src/TagGroup.tsx:46–67  ·  view source on GitHub ↗
({
  children,
  ...props
}: Omit<TagProps, 'children'> & {
  children?: React.ReactNode;
})

Source from the content-addressed store, hash-verified

44}
45
46export function Tag({
47 children,
48 ...props
49}: Omit<TagProps, 'children'> & {
50 children?: React.ReactNode;
51}) {
52 let textValue = typeof children === 'string' ? children : undefined;
53 return (
54 <AriaTag textValue={textValue} {...props} className="react-aria-Tag button-base">
55 {({allowsRemoving}) => (
56 <>
57 {children}
58 {allowsRemoving && (
59 <Button slot="remove" className="remove-button">
60 <X />
61 </Button>
62 )}
63 </>
64 )}
65 </AriaTag>
66 );
67}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected