Skip to Content
Embed on your siteStyling and attributes

Reference

Everything the widget accepts and everything it renders. The embed builder writes the attributes for you; this page is for when you want to hand-edit a snippet or restyle the result.

Data attributes

AttributeRequiredWhat it does
data-kanu-widgetYesMarker attribute (no value needed). Identifies the container.
data-supabase-urlYesYour Supabase project URL.
data-supabase-keyYesYour Supabase anon (public) key.
data-base-urlNoBase URL for card links. Defaults to https://needs.kanuhawaii.org .
data-islandsNoComma-separated island slugs (e.g. “oahu,maui,hawaii”).
data-causesNoComma-separated cause slugs.
data-activity-typesNoComma-separated activity type slugs.
data-good-forNoComma-separated good-for tag slugs.
data-campaign-idNoCampaign UUID — overrides filter slugs.
data-malama-hawaiiNoSet to “true” to show only Mālama Hawaiʻi organizations.
data-turnstile-site-keyNoCloudflare Turnstile site key, which turns on the captcha in the sign-up form. Public by design. Leave it out and sign-ups still work, under a tighter rate limit.
data-limitNoCards per page: how many show at first, and how many each Load more adds (default: 12).
data-moreNoWhat sits under the feed. “link” (the default) links to all opportunities on Kanu with the visitor’s filters; “load” shows a Load more button that adds the next page in place.
data-show-countNoShow “N opportunities in the next 6 months” above the feed. Counts every date an opportunity meets in that window (a weekly one counts about 26 times), plus each open-ended opportunity once, under the current filters. Set to “false” to hide (default: true).
data-card-per-dateNoOne card per day an opportunity meets, soonest first, instead of one card per opportunity with a few date chips. Opening a card picks that date in the sign-up form. Set to “true” (default: false).
data-open-ended-everyNoEvery Nth card is an ongoing, open-ended opportunity, sprinkled between the dated ones the way needs.kanuhawaii.org does (default: 5, so four dated cards then one ongoing). Set to “0” to list open-ended opportunities after every dated card instead. Which open-ended ones come first changes once a day.
data-show-searchNoShow search bar. Set to “false” to hide (default: true).
data-show-filtersNoShow interactive filter dropdowns (island, cause, activity, good-for). Set to “true” to show (default: false). The configurator above turns this on for you.
data-island-tabsNoShow a row of island tabs across the top. Set to “true” to show (default: false). Replaces the island dropdown, so the same choice is not offered twice.
data-date-filterNoShow a date picker built for trip planning: one-click presets (this weekend, next weekend, next 7 and 30 days, and each of the next 12 months) beside a calendar that only offers future days. Set to “true” to show (default: false). A recurring opportunity matches when any of its dates falls in the range. It sits on the same row as the search bar.
data-malama-filterNoShow a Mālama Hawaiʻi certified toggle the visitor can press. Set to “true” to show (default: false). Ignored when data-malama-hawaii is already “true”, since the feed is restricted anyway.
data-date-type-filterNoShow Recurring / Include open-ended / One time checkboxes. Set to “true” to show (default: false). Opens on recurring and one time, so open-ended opportunities are left out until a visitor ticks them.

The order of the cards

The widget orders opportunities the way needs.kanuhawaii.org does:

  • Soonest first. Dated opportunities are listed by the next day they meet.
  • Rarer first within a day. On any one day, an opportunity that happens once comes before one that meets every week, and that comes before one that meets every day. A Saturday beach cleanup leads a daily food-bank shift on that Saturday, instead of being buried under it.
  • Ongoing ones sprinkled in. Open-ended opportunities have no date to sort by, so every fifth card is one of them (change or turn this off with data-open-ended-every). Which ones come first changes once a day, so each gets its turn near the top.

Making it match your site

The widget uses class names prefixed kanu-w-, scoped under a .kanu-widget-root container. Override any of them by adding CSS after the widget script loads. All the class names below are stable and safe to target.

The widget injects its own styles as a <style id="kanu-widget-styles"> tag in the document head, so your site’s CSS naturally wins when it comes after. If you need to replace the defaults entirely, remove that element once the script has loaded.

The sign-up modal is attached to the page <body> and carries the .kanu-widget-root class too, so a rule scoped to .kanu-widget-root or to a bare .kanu-w- class styles the modal as well as the cards.

CSS classes

ClassElement
.kanu-widget-rootOuter container — set font-family, color, max-width here
.kanu-w-toolbarThe row holding the search bar and the date picker side by side; wraps on a phone. Put spacing below the controls here
.kanu-w-searchSearch bar wrapper
.kanu-w-search inputSearch input field
.kanu-w-filtersFilter dropdown row (flex container)
.kanu-w-filter-selectIndividual filter dropdown
.kanu-w-gridCard grid (CSS Grid)
.kanu-w-cardIndividual card link
.kanu-w-card-imgCard image area
.kanu-w-card-img imgCard image element
.kanu-w-card-img-placeholderStand-in shown when an opportunity has no image
.kanu-w-datesDate chip group, top-left over the image
.kanu-w-dateOne date chip
.kanu-w-date--miniThe smaller chips for later dates
.kanu-w-date--openThe chip shown when there is no fixed date (OPEN / RECURRING)
.kanu-w-date-monthMonth line inside a date chip
.kanu-w-date-dayDay number inside a date chip
.kanu-w-date-yearYear line inside the first date chip
.kanu-w-islandsIsland badge group, top-right over the image
.kanu-w-islandOne island badge, and the “+N” overflow badge
.kanu-w-island--oahu, --maui, --kauai, --hawaii, --molokai, --lanai, --remotePer-island class on each badge, so islands can be coloured individually
.kanu-w-island--moreThe “+N” overflow badge specifically
.kanu-w-island-iconThe island’s silhouette inside its badge
.kanu-w-card-bodyCard text content area
.kanu-w-card-titleCard title text
.kanu-w-orgOrganization row (logo plus name)
.kanu-w-org-logoOrganization logo image
.kanu-w-org-logo--initialStand-in circle when the organization has no logo
.kanu-w-card-orgOrganization name text
.kanu-w-card-descDescription text
.kanu-w-tagsTag pill group under the description
.kanu-w-tagOne tag pill. Causes, activity types and good-for all share this class, so a single rule recolours every tag
.kanu-w-dpDate picker wrapper (data-date-filter)
.kanu-w-dp-triggerThe button showing “Any dates” or the chosen range
.kanu-w-dp-clearThe × that clears the dates
.kanu-w-dp-popThe picker popover
.kanu-w-dp-presetOne preset (a weekend, a month); .kanu-w-dp-preset--active when chosen
.kanu-w-dp-dayOne calendar day; --start, --end and --in mark the range, --today today
.kanu-w-countThe “N opportunities in the next 6 months” line above the grid
.kanu-w-moreLoad more button row (data-more=“load”)
.kanu-w-more-btnThe Load more button
.kanu-w-malamaWrapper around the Mālama Hawaiʻi badge and its tooltip. On a card it sits under the description, above the tags
.kanu-w-malama-badge“Mālama Hawaiʻi certified” pill on a card and in the modal
.kanu-w-tipThe tooltip explaining Mālama Hawaiʻi, shown on hover (and on focus in the modal)
.kanu-w-ctaFooter CTA link container
.kanu-w-cta aCTA link
.kanu-w-loadingLoading state wrapper
.kanu-w-spinnerLoading spinner
.kanu-w-emptyEmpty state wrapper
.kanu-w-errorError state wrapper
.kanu-w-modal-overlaySign-up modal backdrop. Also carries .kanu-widget-root
.kanu-w-modalSign-up modal panel
.kanu-w-modal-bodyScrolling content area inside the panel
.kanu-w-modal-tabsDetails / Organization / Register tab row
.kanu-w-modal-tabOne tab button
.kanu-w-modal-tab--activeThe selected tab
.kanu-w-modal-panelA tab panel (the hidden one carries [hidden])
.kanu-w-modal-actionsThe Details panel’s button row
.kanu-w-modal-closeModal close (X) button
.kanu-w-modal-imgModal image area
.kanu-w-modal-orgOrganization name above the modal title; opens the Organization tab
.kanu-w-factsDetails list: when, causes, activities, good for, requirements, minimum age, where
.kanu-w-factOne row of that list (a dt label and a dd value)
.kanu-w-scheduleThe upcoming dates and shift times inside the When row
.kanu-w-org-headLogo and name at the top of the Organization tab
.kanu-w-org-linksWebsite and social links on the Organization tab
.kanu-w-modal-titleModal opportunity title
.kanu-w-modal-metaModal date/island line
.kanu-w-modal-descModal description text
.kanu-w-modal-form-areaWrapper around the form or the full sign-up hand-off
.kanu-w-modal-noteExplanation shown when sign-up must finish on Kanu
.kanu-w-modal-fulllinkLink out to the full sign-up page on Kanu
.kanu-w-formRegistration form (flex container)
.kanu-w-fieldOne label plus input pair inside the form
.kanu-w-labelForm field label
.kanu-w-inputForm text/number input
.kanu-w-textareaForm message textarea
.kanu-w-checkboxForm consent checkbox row
.kanu-w-btnPrimary button (Register / full sign-up)
.kanu-w-btn--secondarySecondary button (Close)
.kanu-w-form-errorInline form error message
.kanu-w-form-successPost-submit success state
.kanu-w-success-titleHeadline inside the success state

Example: match your brand colours

/* Add this to your site, after the widget loads */ .kanu-widget-root { font-family: 'Your Brand Font', sans-serif; } /* The accent: search focus, active tab, CTA */ .kanu-w-search input:focus { border-color: #your-brand-color; box-shadow: 0 0 0 3px rgba(your-r, your-g, your-b, 0.1); } .kanu-w-tab--active { background: #your-brand-color; border-color: #your-brand-color; } .kanu-w-cta a { color: #your-brand-color; } /* The grid */ .kanu-w-grid { grid-template-columns: repeat(2, 1fr); /* always two columns */ gap: 12px; } .kanu-w-card { border-radius: 8px; }

Example: a dark background

.kanu-widget-root { color: #e0e0e0; } .kanu-w-card { background: #1e1e1e; border-color: #333; } .kanu-w-card-org { color: #aaa; } .kanu-w-card-desc { color: #ccc; } .kanu-w-search input { background: #2a2a2a; border-color: #444; color: #e0e0e0; } .kanu-w-tab { background: #2a2a2a; border-color: #444; color: #ccc; }

Mālama Hawaiʻi is a complete worked example: a full theme measured off a live WordPress site, in one snippet.

Last updated on