MCPcopy Create free account
hub / github.com/SyntaxUI/syntaxui / Prose

Function Prose

src/components/Prose.tsx:3–24  ·  view source on GitHub ↗
({
  as,
  className,
  ...props
}: Omit<React.ComponentPropsWithoutRef<T>, 'as' | 'className'> & {
  as?: T
  className?: string
})

Source from the content-addressed store, hash-verified

1import clsx from 'clsx'
2
3export function Prose<T extends React.ElementType = 'div'>({
4 as,
5 className,
6 ...props
7}: Omit<React.ComponentPropsWithoutRef<T>, 'as' | 'className'> & {
8 as?: T
9 className?: string
10}) {
11 let Component = as ?? 'div'
12
13 return (
14 <Component
15 className={clsx(
16 className,
17 'prose dark:prose-invert',
18 // `html :where(& > *)` is used to select all direct children without an increase in specificity like you'd get from just `& > *`
19 '[html_:where(&>*)]:mx-auto [html_:where(&>*)]:max-w-2xl [html_:where(&>*)]:lg:mx-[calc(50%-min(50%,theme(maxWidth.lg)))] [html_:where(&>*)]:lg:max-w-5xl',
20 )}
21 {...props}
22 />
23 )
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected