Skip to content

Instantly share code, notes, and snippets.

@achingachris
Created August 8, 2021 15:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Using Bootstrap in NextJS with Head and Script components from NextJS
import Head from 'next/head'
import Script from 'next/script'
const index = () => {
return (
<Head>
<link
rel='stylesheet'
href='https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css'
referrerPolicy='no-referrer'
/>
</Head>
// page content
// some code goes here
<Script
src='https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js'
strategy='afterInteractive'
/>
)
}
export default index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment