A span element with control for typographic attributes.
Generally, span tags will go inside p tags and inherit whatever typographical attributes that paragraph has. But because spans are not limited to being inside paragraphs, this elements also allows you to control typographic attributes.
The tracking's default value depends on the size prop and is controlled through CSS variables: check out the styling section.
<P> <Span>This is a span.</Span></P>Here's the <Span /> component in action.
This is a span.
import { forwardRef, type HTMLAttributes } from 'react'import { cn } from '#app/utils/tailwind-merge.ts'
/** * A span component. */const Span = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLSpanElement>>(({ className, ...props }, ref) => <span ref={ref} className={cn('span', className)} {...props} />)Span.displayName = 'Span'
export { Span }