MCPcopy Create free account
hub / github.com/vercel/examples / Text

Function Text

internal/packages/ui/src/text.tsx:22–44  ·  view source on GitHub ↗
({
  style,
  className = '',
  variant = 'body',
  children,
}: Props)

Source from the content-addressed store, hash-verified

20}
21
22export const Text = ({
23 style,
24 className = '',
25 variant = 'body',
26 children,
27}: Props) => {
28 const componentsMap: {
29 [P in Variant]: ComponentType<any> | string
30 } = {
31 h1: 'h1',
32 h2: 'h2',
33 body: 'p',
34 description: 'p',
35 smallText: 'small',
36 }
37 const Component: ComponentType<any> | string = componentsMap[variant]
38
39 return (
40 <Component className={clsx(variants[variant], className)} style={style}>
41 {children}
42 </Component>
43 )
44}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected