Primer React Components can be used in Markdown files by importing them from @primer/react
.
Refer to the Primer React documentation for more information on which components are available and how to use them.
Importing and using Primer components
- Import a component from
@primer/react
:
import {Button} from '@primer/react'
- Use the component in your Markdown file, but ensure that you wrap the component in a
div
with thecustom-component
class. This will ensure that article formatting isn't applied to the custom component.
<div className="custom-component">
<Button variant="primary">Danger</Button>
</div>