DEV3 Technologies home

Free code snippets

Free code snippets, page 7

Small, self-contained patterns from real DEV3 products, each explained, with a live preview where it makes sense. Copy them into your project; commercial use is fine.
200
snippets
7
stacks

All snippets

Filament · PermissionsFilament canAccessPanel role guard on the user modelDecide which Filament 4 panel each user may open with a role enum and canAccessPanel, including active and approval checks.filamentrolespanels Tailwind CSS · LayoutsNo-JS FAQ accordion with details and summaryA pure HTML accordion built on details and summary with a rotating chevron, grouped open state and zero JavaScript.faqaccordiondetails WordPress · LayoutsUpcoming events archive with month gridOrder an event archive by date, hide past events and render a month calendar grid that groups events by day.eventscalendarwp-query Tailwind CSS · Feedback and empty statesEmpty-state panelA centered empty-state block with an icon, a short explanation and primary and secondary actions for blank lists.empty-statepanelonboarding React / Next.js · UtilitiesEMI and amortisation scheduleCalculate a fixed monthly instalment and a full month-by-month principal and interest schedule that ends exactly at zero.loanemifinance Laravel · MiddlewareEmbed loader with domain allowlistServe a widget script only to pages on approved domains, with wildcard subdomain matching and a frame-ancestors header to match.embedcorsallowlist WordPress · HooksElementor widget skeletonA minimal custom Elementor widget with controls, escaped rendering and the registration hook, ready to extend.elementorwidgetpage-builder React / Next.js · UtilitiesEAN-13 barcode renderer in SVGCompute the EAN-13 check digit and draw the bars as a dependency-free SVG React component.barcodeean-13svg Laravel · APIsDynamic QR redirect with scan statsA short-code redirect route that looks up a cached destination and counts scans per day with one atomic upsert after the response is sent.redirectanalyticsupsert WordPress · ThemingDrop cap paragraph block styleRegister a Drop cap style for the paragraph block and style it with a pure CSS first-letter rule that works in editor and front end.block-stylesdrop-captypography Laravel · DatabaseTamper-evident document audit trailAppend-only audit events where each row stores a hash of the previous one, with a verify method that detects edited or deleted history.audithash-chaineloquent Tailwind CSS · NavigationDocs sidebar with scroll-spyA sticky table of contents that highlights the section currently in view, driven by IntersectionObserver.docssidebarscroll-spy Tailwind CSS · CardsDigital business card layoutA phone-friendly contact card with a cover band, overlapping avatar, call, text and web shortcuts and a save-contact button.business-cardprofilecontact WordPress · UtilitiesOne-click demo content importerAn admin tools page that imports pages and posts from a bundled JSON file idempotently, behind a nonce and capability check.importdemo-contentadmin-page Laravel · DatabaseDelivery-slot capacity bookingReserve a delivery time slot with a single conditional UPDATE that cannot oversell, plus a matching release when an order is cancelled.bookingcapacityatomic Tailwind CSS · FormsStar rating input with no JavaScriptAn accessible five-star rating field made from radio buttons and sibling selectors, so it submits with any form and needs no script.ratingstarsradio React / Next.js · UtilitiesCrypto-random password generatorGenerate unbiased random passwords with the Web Crypto API, guaranteeing each chosen character class appears.passwordcryptorandom Laravel · APIsCookieless pageview collectorA tracking endpoint that identifies visitors with a daily-rotating salted hash instead of cookies, so no personal data is ever stored.analyticsprivacycookieless Tailwind CSS · ModalsCookie consent banner with stored choiceA bottom cookie banner that stores the visitor's choice, loads optional scripts only after opt-in and can be reopened from the footer.cookiesconsentprivacy Tailwind CSS · SearchCommand palette searchA keyboard driven command palette that opens with Ctrl or Cmd K, filters a list as you type and runs the highlighted entry.command-palettesearchkeyboard Tailwind CSS · LayoutsComing-soon page with countdownA full-screen coming-soon layout with a live day, hour, minute and second countdown to a launch date.countdowncoming-soonlaunch Tailwind CSS · NavigationCollapsible admin sidebarAn admin sidebar that toggles between full width and an icon rail, keeping labels accessible and remembering nothing server side.sidebaradmincollapse WordPress · LayoutsWeekly class timetable gridTurn a flat list of sessions into an accessible day-by-time table with a shortcode, escaped output and empty cell handling.timetableschedulegrid Laravel · UploadsChunked upload endpointAccept large files in small indexed parts, store them in a temp folder and assemble them on completion, so uploads survive flaky connections.uploadchunkslarge-files