Installation
How to install and set up Dracula UI in your project.
Installing the package
Inside your project directory, install Dracula UI by running either of the following:
npm install dracula-uiyarn add dracula-ui
Using with HTML
You can use Dracula UI with plain HTML by importing the CSS file.
<link rel="stylesheet" href="node_modules/dracula-ui/styles/dracula-ui.css" />
Now you can take advantage of all the classes, for example:
<p class="drac-text drac-text-black">Hello Vampire</p>
Using with React
You can also use Dracula UI with React by importing the JS package.
import 'dracula-ui/styles/dracula-ui.css'import { Paragraph } from 'dracula-ui'function App() {return <Paragraph color="black">Hello Vampire</Paragraph>}export default App;
Using with Next.js
First, you need to import the CSS globally.
Go to pages/_app.js
(or create this file if it doesn't exist yet) and add the CSS import:
import 'dracula-ui/styles/dracula-ui.css'function MyApp({ Component, pageProps }) {return <Component {...pageProps} />}export default MyApp
Then you can import and use Dracula UI's React components as expected.
import { Component } from 'react'import { Paragraph } from 'dracula-ui'class Index extends Component {render() {return <Paragraph color="black">Hello Vampire</Paragraph>}}export default Index
Using with Jekyll
Go to _config.yml
and include the node_modules
folder:
include:- node_modules
Create a Sass file at assets/css/styles.scss
with the following content:
------@import "../../node_modules/dracula-ui/styles/dracula-ui.css"
The empty front matter at the top tells Jekyll it needs to process the Dracula UI file.
Finally, include the compiled CSS file into your _layouts
.
<link rel="stylesheet" href="/assets/css/styles.css">