Alright, let’s get you up and running with CodeNHammer! We’ve made it super easy to dive in and start building your projects. This guide will walk you through setting up and integrating CodeNHammer components into your project with ease. Follow these steps to bring our customizable layouts and UI components to life on your small business or contractor website.
Before diving into CodeNHammer components, ensure your project environment is ready:
npm install -D tailwindcss@latest
@tailwind base; @tailwind components; @tailwind utilities;
script
tag in your head
tag:<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
<a href="#" class="w-full md:w-auto cursor-pointer inline-flex items-center justify-center px-4 py-2 text-sm text-center font-medium tracking-wide transition-colors duration-100 border-2 border-neutral-900 text-neutral-50 rounded-md bg-neutral-900 hover:bg-neutral-800 hover:border-neutral-800"> Primary Button </a>
<div x-data="{ dropdownOpen: false }" class="relative"> <!-- Button Dropdown --> <button type="button" @click="dropdownOpen=true" class="flex items-center -mx-3 px-3 py-2 font-medium text-neutral-900" aria-expanded="false"> <span>Dropdown</span> <svg :class="{ '-rotate-180' : dropdownOpen }" class="ml-1 size-4 ease-out duration-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"></polyline></svg> </button> <!-- Container Transition --> <div x-show="dropdownOpen" @click.away="dropdownOpen=false" x-transition:enter="ease-out duration-200" x-transition:enter-start="-translate-y-2" x-transition:enter-end="translate-y-0" x-cloak> <!-- Links --> <div class="space-y-4 grid grid-cols-1 *:text-sm *:text-neutral-500 *:mx-4 *:font-medium"> <ul class="space-y-3"> <li> <a href="#">Link 1</a> </li> <li> <a href="#">Link 2</a> </li> <li> <a href="#">Link 3</a> </li> </ul> </div> </div> </div>
text-neutral-900
to text-green-500
to match your brand colors.CodeNHammer components are built with responsiveness in mind, but you can further customize their behavior for various screen sizes:
sm:
, md:
, lg:
, etc. to control how components behave on different screen sizes. Here’s an example of a responsive button:<a href="#" class="w-full md:w-auto cursor-pointer inline-flex items-center justify-center px-4 py-2 text-sm text-center font-medium tracking-wide transition-colors duration-100 text-neutral-50 rounded-md bg-neutral-900 sm:bg-green-500 md:bg-red-500 lg:bg-purple-500"> Button </a>
CodeNHammer is continuously updated with new components and improvements. To stay current: