MCPcopy Create free account
hub / github.com/TanStack/devtools / Tag

Function Tag

packages/devtools-ui/src/components/tag.tsx:5–22  ·  view source on GitHub ↗
(props: {
  color: keyof typeof tokens.colors
  label: string
  count?: number
  disabled?: boolean
})

Source from the content-addressed store, hash-verified

3import type { tokens } from '../styles/tokens'
4
5export const Tag = (props: {
6 color: keyof typeof tokens.colors
7 label: string
8 count?: number
9 disabled?: boolean
10}) => {
11 const styles = createStyles()
12 return (
13 <button
14 data-tsd-control
15 disabled={props.disabled}
16 class={styles().tag.base}
17 >
18 <span class={styles().tag.dot(props.color)} />
19 <span class={styles().tag.label}>{props.label}</span>
20
21 <Show when={props.count && props.count > 0}>
22 <span class={styles().tag.count}>{props.count}</span>
23 </Show>
24 </button>
25 )

Callers

nothing calls this directly

Calls 1

createStylesFunction · 0.90

Tested by

no test coverage detected