A Gallery/Lightbox component styled with TailwindCSS for Nuxt 3 (Typescript included!).
Based on Frontend Mentor E-commerce product page Lightbox.
nuxt-tailwind-lightbox
dependency to your project# Using pnpm
pnpm add -D nuxt-tailwind-lightbox
# Using yarn
yarn add --dev nuxt-tailwind-lightbox
# Using npm
npm install --save-dev nuxt-tailwind-lightbox
nuxt-tailwind-lightbox
to the modules
section of nuxt.config.ts
export default defineNuxtConfig({
modules: [
'nuxt-tailwind-lightbox'
]
})
tailwind.config.js
template path:module.exports = {
content: [
// other files...
'./node_modules/nuxt-tailwind-lightbox/**/*.{js,ts,vue}',
],
}
That's it! You can now use the <NuxtTailwindLightbox :image-list="your_image_list_array" />
component in your Nuxt app ✨
Name | Type | Default | Description |
---|---|---|---|
image-list |
Array |
--- | Array of images to fill the gallery |
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release