0.0.0 • Published 2 years ago
@holocron.so/components v0.0.0
Install
npm install @holocron.so/componentsUsage with tailwind
// tailwind.config.js
/** @type {import('tailwindcss').Config} */
const config = {
content: [
// ...
'./node_modules/@holocron.so/components/dist/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
darkMode: 'class',
}
export default configUsage without Tailwind
import '@holocron.so/components/styles.css'Using the components in MDX
First add the Holocron namespace to your MDX components
// mdx-components.jsx
import '@holocron.so/components/styles.css'
import * as Holocron from '@holocron.so/components/src'
export function useMDXComponents(components) {
return {
...components,
Holocron,
}
}# MDX file
<Holocron.Callout type='info'>
This is a callout
</Holocron.Callout>You can also expose the components globally in your MDX files for easier access
Why the Holocron namespace?
The Holocron editor automatically detects the components with the Holocron namespace and allows you to edit your MDX files visually in a WYSIWYG editor.
0.0.0
2 years ago