Skip to content

How to pass props to Prose components? #2207

Closed Answered by nobkd
goodpixels asked this question in Q&A
Discussion options

You must be logged in to vote

I don't completely understand, what you want, but I think you're looking for the <ContentSlot> component

(A live reproduction with for example Stackblitz would have been helpful)


In your excerpt / text component, you might need the content slot, maybe like this:

<ContentSlot :use="$slots.default" unwrap="p" />

And, if your Text component is globally available (e.g., in the components/content directory), you could use the MDC syntax to use it directly in Markdown and set the props:

::text{variant="huge"}
your text
::

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@goodpixels
Comment options

Answer selected by goodpixels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants