Skip to content

Instantly share code, notes, and snippets.

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