Skip to content
Back to search

sunrise-dashboard-ui

SkillWorks with Claude CodeGitHub

Build any website, dashboard, member area or admin panel in the Sunrise UI style (clean white cards, Heroicons, gradient stat cards, pay sheets, pagination, mobile tab bar) with admin-changeable theme colours and dark mode.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/dali254--claudefrontend-skills/badge.svg)](/listings/dali254--claudefrontend-skills)

HTML

<a href="/listings/dali254--claudefrontend-skills"><img src="/api/listings/dali254--claudefrontend-skills/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Open `demo/login.html` (or `demo/dashboard.html`) in a browser (sidebar → Admin → Theme studio to recolour).

**Check any page for layout bugs:** add `?sr-debug` to its URL. Anything wider than the screen is outlined red. Automated check of every demo page at 5 widths: `python3 tools/qa.py "$PWD/demo" admin,public,dashboard,login` (needs Playwright).

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap">
  <link rel="stylesheet" href="https://unpkg.com/@phosphor-icons/web@2.1.1/src/regular/style.css">
  <link rel="stylesheet" href="kit/sunrise.css">
  <script>window.SR_THEME = { preset: "ember", icons: "heroicons" };</script>
  <script src="kit/sunrise-theme.js"></script>
</head>
<body>
  … shell from demo/dashboard.html …
  <script src="kit/sunrise-icons.js"></script>
  <script src="kit/sunrise-ui.js"></script>
</body>

Change colours without JS: `:root{--brand:#2563eb;--brand-2:#38bdf8;--brand-3:#7c3aed}`. Presets: `ember`, `ocean`, `emerald`, `royal`, `rose`, `cobalt`, `gold`, `graphite`. Icon libraries: `heroicons` (default), `fluent`, `lucide`, `tabler`, `fontawesome`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 534 lines
  1. ---
  2. name: sunrise-dashboard-ui
  3. description: Build any website, dashboard, member area or admin panel in the Sunrise UI style (clean white cards, Heroicons, gradient stat cards, pay sheets, pagination, mobile tab bar) with admin-changeable theme colours and dark mode.
  4. ---
  5. # Sunrise Dashboard UI · v4
  6. A premium, framework-free design system for dashboards, member areas and admin panels:
  7. **clean white cards with high-contrast text**, glass only on the top bar / tab bar / sheets,
  8. **Heroicons** (5 switchable icon libraries), floating sidebar, ticket-style
  9. balance card, gradient stat cards, feature tiles with ghost icons and hover shine, coin
  10. reward cards, data tables that turn into cards on phones, **pagination**, tabs with a
  11. sliding indicator, modals that become **bottom sheets** on phones, skeleton loaders,
  12. progress rings, toasts, and a floating mobile tab bar. Every click has feedback (ripple,
  13. icon pop, press scale, loading → done states).
  14. **Every brand colour comes from three CSS variables** (`--brand`, `--brand-2`, `--brand-3`).
  15. Admins change them live in the **Theme Studio**; the choice is saved server-side.
  16. Files (this repo): `kit/sunrise.css`, `kit/sunrise-theme.js`, `kit/sunrise-icons.js`, `kit/sunrise-ui.js`;
  17. icon builder `tools/build-icons.py`;
  18. reference pages `demo/dashboard.html`, `demo/transactions.html`, `demo/pages.html`.
  19. ---
  20. ## 0. Non-negotiable rules
  21. 1. **Use the kit files verbatim.** Copy the four `kit/` files unchanged into the project
  22. (e.g. `public/assets/sunrise/`). Project-specific CSS goes in a separate `app.css` loaded after.
  23. 2. **One shell, every page.** Every page uses the shell from `demo/dashboard.html`
  24. (rail + topbar + `sr-main > sr-page` + tab bar + drawer + toasts). Put it in ONE layout
  25. file and the nav in ONE array so sidebar, drawer and tab bar never drift.
  26. 3. **Always responsive — on every page, every component, no exceptions** (Section 3).
  27. 4. **Class prefix `sr-`.** New components follow `sr-block`, `sr-block__part`,
  28. `sr-block--variant`, state `is-*`. Never invent un-prefixed component classes.
  29. 5. **No hard-coded brand colours.** Use `--brand`, `--brand-fg`, `--brand-soft`,
  30. `--grad-brand`, `--grad-sunrise`, `--grad-horizon`, and neutrals `--paper`, `--surface`,
  31. `--surface-2`, `--sunken`, `--line`, `--line-strong`, `--heading`, `--text`, `--muted`, `--faint`.
  32. 6. **Colour per feature = `tone-*` class**: `tone-brand | tone-violet | tone-indigo | tone-cyan
  33. | tone-sky | tone-amber | tone-rose | tone-success | tone-danger | tone-neutral`.
  34. Neighbouring cards and sidebar links get different tones.
  35. 7. **Icons: real colour icons for features, Phosphor regular for small controls** (Section 4).
  36. Never emoji, never AI-drawn/hand-made SVG icons, never other icon sets.
  37. 8a. **No tilted or rotated UI.** Icons, buttons, tabs and cards never rotate or flip — motion is
  38. scale/translate/opacity only. Hover effects only apply on real pointers (`@media (hover:hover)`).
  39. 8. **Every interactive element gives feedback** (Section 5). Async buttons use `SRButton.run`.
  40. 9. **Every list longer than ~10 items is paginated** (or "Load more") — Section 6.
  41. 10. **Every data view has 4 states:** loading (skeleton), empty (`sr-empty`), error
  42. (`sr-alert tone-danger` + retry), and content.
  43. 11. **Both light and dark must work**; test one extra preset (e.g. `SRTheme.preset('ocean')`).
  44. 12. **Honest UI.** Toasts, counters and notifications come from real backend data. Never
  45. build fake "someone just withdrew" tickers, fake counters or fake reviews.
  46. 13. **Accessibility:** `aria-label` on icon-only buttons, `aria-current="page"` on active nav,
  47. `role="tablist"/"tab"` + `aria-selected`, `role="dialog"` + `aria-modal` on modals, labels
  48. on all inputs, text contrast ≥ 4.5:1, focus visible (kit provides), honours reduced motion (kit provides).
  49. ---
  50. ## 1. Install (head of every page — order matters)
  51. ```html
  52. <meta charset="utf-8">
  53. <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
  54. <meta name="theme-color" content="#fbf8f5">
  55. <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  56. <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap">
  57. <link rel="stylesheet" href="https://unpkg.com/@phosphor-icons/web@2.1.1/src/regular/style.css">
  58. <link rel="stylesheet" href="/assets/sunrise/sunrise.css">
  59. <link rel="stylesheet" href="/assets/app.css"><!-- optional project overrides -->
  60. <script>window.SR_THEME = {"preset":"ember","brand":"#ff5b14","brand2":"#ffb21e","brand3":"#f0306e","radius":1,"font":"sora","allowUserColors":false};</script>
  61. <script src="/assets/sunrise/sunrise-theme.js"></script>
  62. ```
  63. End of `<body>`, in this order:
  64. ```html
  65. <script src="/assets/sunrise/sunrise-icons.js"></script>
  66. <script src="/assets/sunrise/sunrise-ui.js"></script>
  67. ```
  68. `sunrise-icons.js` bundles the colour icons as inline SVG (no CDN, works offline). For self-hosting
  69. Phosphor, download `@phosphor-icons/web` from npm and serve `src/regular/style.css` + `Phosphor.woff2`.
  70. ---
  71. ## 2. Theming (admin-changeable)
  72. Inputs: `--brand` (main), `--brand-2` (dawn, lighter accent), `--brand-3` (dusk, deeper accent).
  73. Everything else (hover, soft tints, gradients, tinted neutrals, shadows, dark variants) is derived.
  74. Presets: `ember` (default), `ocean`, `emerald`, `royal`, `rose`, `cobalt`, `gold`, `graphite`.
  75. - **Theme Studio:** any `[data-sr-studio-open]` opens a panel (presets, 3 colour pickers,
  76. light/dark/auto, corner radius, heading font). "Publish" POSTs `SRTheme.toJSON()`:
  77. `SRStudio.mount({ saveUrl:'/admin/theme', csrf })` or `SRStudio.mount({ onSave: cfg => … })`.
  78. Render the trigger for admins only.
  79. - **Server config:** store the JSON, print it into `window.SR_THEME` before `sunrise-theme.js`.
  80. - **Static CSS:** `:root{--brand:#2563eb;--brand-2:#38bdf8;--brand-3:#7c3aed}` after `sunrise.css`.
  81. - **API:** `SRTheme.apply({...})`, `.preset(id)`, `.setMode('light'|'dark'|'system')`,
  82. `.toggleMode()`, `.isDark()`, `.get()`, `.reset()`, `.toJSON()`, `.toCSS()`; event `sr:theme`.
  83. - Light/dark is always the user's choice; colours are site-wide unless `allowUserColors: true`.
  84. ---
  85. ## 3. Responsive rules (mandatory on every page)
  86. Breakpoints: **≤640 phone · 641–767 large phone · ≥768 tablet (rail appears) · ≥1024 laptop
  87. (2-column layouts) · ≥1280 wide**. Design phone-first, then widen.
  88. - Always test at **360, 390, 768, 1024, 1440 px**. No horizontal scroll at any width
  89. (except inside `.sr-table-wrap` / `.sr-chips` / `.sr-tabs`, which scroll on purpose).
  90. - Use the kit's grids: `sr-top`, `sr-stats`, `sr-tile-grid`, `sr-reward-grid`, `sr-media-grid`,
  91. `sr-split` (main + side, stacks under 1024), `sr-grid` (auto-fit, `style="--min:18rem"`).
  92. Never set fixed pixel widths on cards; use `minmax(0,1fr)` and `min-width:0` on flex children.
  93. - Navigation: rail ≥768; phones get `sr-tabbar` (max 5 items, centre = main action
  94. `sr-tab--cta`) + `sr-drawer` cloned from the rail. Phone-only shortcuts: `sr-quick`.
  95. - Tables: always `sr-table` inside `sr-table-wrap`, with `data-label` on every `<td>` and
  96. `class="is-main"` on the first cell — it becomes a stacked card under 640px.
  97. - Modals: `sr-modal` automatically becomes a bottom sheet under 640px.
  98. - Pagination collapses to `‹ 2 / 9 ›` on phones.
  99. - Touch targets ≥ 44px on phones (kit sizes already comply). Inputs ≥ 16px font on phones
  100. are not needed because the kit uses 15px+ height-3rem inputs; keep `inputmode` correct
  101. (`decimal`, `tel`, `email`, `numeric`).
  102. - Long text: `overflow:hidden;text-overflow:ellipsis;white-space:nowrap` on titles in
  103. rows/tiles (kit classes already do this); never let a name push buttons off-screen.
  104. - Safe areas: kit uses `env(safe-area-inset-*)` for top bar, tab bar, drawer and sheets — keep `viewport-fit=cover`.
  105. - Hide/show helpers: `sr-hide-sm` (hidden <640), `sr-hide-mobile`, `sr-only-mobile`,
  106. `sr-hide-md`, `sr-show-md`.
  107. ---
  108. ## 4. Icons — real colour icons + glass tiles
  109. **Five icon libraries are bundled; the admin picks one** (Theme Studio → Icon library, or
  110. `window.SR_THEME = {icons:'tabler'}`, or `SRTheme.apply({icons:'lucide'})`). Markup never changes —
  111. `<i class="sr-icon" data-icon="trophy">` renders in whichever library is active:
  112. | `icons` value | Library | Look | License |
  113. |---|---|---|---|
  114. | `heroicons` (**default**) | Heroicons (Tailwind Labs) | 1.5px outline; tinted tiles, white on solid gradient tiles | MIT |
  115. | `fluent` | Microsoft Fluent UI System Color | real multi-colour icons in white glass tiles | MIT |
  116. | `lucide` | Lucide | 2px line icons tinted with the card's tone | ISC |
  117. | `tabler` | Tabler Icons | line icons for dashboards, tinted | MIT |
  118. | `fontawesome` | Font Awesome Free (solid) | bold filled glyphs, tinted | CC BY 4.0 |
  119. Single-colour libraries are coloured automatically by the container's `tone-*`. One element can force
  120. a library with `data-pack="lucide"`. Each semantic name in `tools/icon_map.py` maps to all five; to add
  121. icons, extend that map and run `tools/build-icons.py` (see its header for the npm packages).
  122. Font Awesome Free icons require attribution (CC BY 4.0) — keep the README credit if you choose it.
  123. **Optional colour set = Microsoft Fluent UI System Color Icons** (MIT, free for commercial use,
  124. 196 icons bundled in `kit/sunrise-icons.js`). They are professionally designed, multi-colour,
  125. and keep their own colours in every theme.
  126. ```html
  127. <i class="sr-icon" data-icon="trophy"></i> <!-- hydrated to inline SVG automatically -->
  128. <i class="sr-icon sr-icon--lg" data-icon="savings" aria-label="Wallet"></i>
  129. ```
  130. - Use them for: nav links, tab bar, feature tiles (`sr-glyph`), stats (`sr-stat__icon`), quick actions,
  131. reward coins, panel heads, list/table row icons, alerts, toasts, empty states, unlock cards.
  132. - Always place them inside a **glass icon tile** container: `sr-nav-link__icon`, `sr-glyph`,
  133. `sr-stat__icon`, `sr-quick__icon`, `sr-reward__coin`, `sr-panel__icon`, `sr-row__icon`, `sr-ic`
  134. (+ `sr-ic--lg`), `sr-lock__icon`, `sr-toast__icon`, `sr-tab__icon`. The tile's glow ring takes the
  135. `tone-*` colour of its parent, so give each card/link a tone.
  136. - Sizes: `sr-icon--xs|sm|md|lg|xl`; decorative ghost: `<i class="sr-icon sr-tile__ghost" data-icon="star" aria-hidden="true">`.
  137. - Tab bar: idle icons are muted; the active tab gets a gradient tile with a white icon; the centre CTA is a gradient tile with a white icon and a ring.
  138. - Friendly aliases work: `home, wallet, transactions, users, referrals, store, video, ai, course, chat, walk,
  139. theme, bell, chart, trading, verified, medal, lock, goal, check, bank, mobile, send, loans, tips, user, admin,
  140. menu, search, docs, pro, location` … List all names in the console: `SRIcons.names()`.
  141. - Core names: `home savings coin-multiple receipt history people people-add people-community people-team
  142. building building-store building-government clipboard-task poll video bot-sparkle book-open-lightbulb
  143. chat-multiple sport paint-brush add-starburst alert data-trending data-bar-vertical-ascending data-pie
  144. shield-checkmark certificate ribbon-star trophy gift lock-closed gauge checkmark-circle warning error-circle
  145. question-circle phone send calendar calendar-checkmark vault lightbulb person person-key settings apps
  146. search-sparkle document-text premium location-ripple mail heart star camera globe headset wrench-screwdriver`.
  147. - Need an icon that is not bundled? Run `python3 tools/build-icons.py package/icons.json kit/sunrise-icons.js`
  148. after `npm pack @iconify-json/fluent-color && tar xzf *.tgz`. For production you may bundle only the
  149. icons you use: add a comma list as the 3rd argument (smaller file).
  150. - Dynamic HTML is hydrated automatically (MutationObserver); call `SRIcons.hydrate(el)` if needed.
  151. **Small control glyphs = Phosphor regular** (`<i class="ph ph-x"></i>`): close, carets, arrows inside
  152. buttons/links, chip and button leading icons, input-group icons, pagination arrows. Keep them neutral
  153. (currentColor) — never put colour icons inside buttons.
  154. ## 4b. Clean white (default) and optional glass
  155. **Default = clean white:** solid white cards (`--surface:#fff`), high-contrast text
  156. (`--heading:#16100d`, `--text:#352c27`, `--muted:#6b5f58`), a very faint brand mesh behind the page, soft
  157. tone-tinted shadows. Glass (blur) is used only on chrome: top bar, tab bar, popovers, modals, drawer, toasts.
  158. Text must always be clearly readable — never put body text on translucent or busy backgrounds, never use
  159. `--faint` for anything that must be read.
  160. **Optional glass cards:** add `class="sr-glass"` to `<html>` to make cards translucent with backdrop blur.
  161. Only use it if the client explicitly asks for glass.
  162. ### Glass details (when `html.sr-glass` is on)
  163. - The page sits on a fixed, blurred brand-colour mesh (`body::before`) — keep it; glass needs colour behind it.
  164. - `--surface` is translucent white (dark: translucent slate). Cards, panels, tiles, rewards, media, rail,
  165. top bar, tab bar, alerts and toasts use `backdrop-filter: var(--glass-blur)` and `--glass-edge` borders
  166. with an inner highlight (`--glass-hl`). Popovers, modals, drawer and Theme Studio use `--glass-strong`.
  167. - Need opaque? use `--surface-solid`. Need a new glass block? `background:var(--surface);
  168. backdrop-filter:var(--glass-blur);border:1px solid var(--glass-edge);box-shadow:var(--glass-hl),var(--sh-sm)`.
  169. - Performance: blur only cards and chrome, never every table row or list item; keep < ~30 blurred
  170. elements on screen.
  171. ## 5. Motion & feedback (built in — just use the classes)
  172. - **Ripple** on press for `.sr-btn, .sr-tile, .sr-nav-link, .sr-reward, .sr-icon-btn,
  173. .sr-account, .sr-page-btn, .sr-chip-btn, .sr-tabs__btn, .sr-menu-item` and any `[data-sr-ripple]`.
  174. - **Icon pop** on click (scale only), **tab-bar bounce** on the active tab, **press scale** `:active` on
  175. buttons, **hover lift + shine sweep** on tiles, rewards, media — hover effects are switched off on
  176. touch devices so nothing stays stuck. Never rotate, skew or flip elements.
  177. - **Count-up numbers:** `<span data-sr-count="12480.5" data-decimals="2">12,480.50</span>`
  178. (keep the real value as the initial text for no-JS/SEO).
  179. - **Scroll reveal:** `data-sr-reveal` (+ `data-sr-delay="60"` to stagger cards). Call
  180. `SRReveal()` after inserting new content.
  181. - **Async buttons:** `SRButton.run(btn, () => fetch(...))` → spinner → green "Done ✓" → restore;
  182. on rejection the button shakes. Validation errors: add `is-invalid` to the input, unhide
  183. `.sr-error`, shake the submit button.
  184. - **Page entrance:** children of `.sr-page` rise in with a stagger automatically.
  185. - Keep durations 150–600ms with `var(--ease)`. Never animate layout-heavy properties in loops.
  186. `prefers-reduced-motion` disables all motion automatically.
  187. ---
  188. ## 6. Data components
  189. **Toolbar (search + segmented tabs + filter chips)**
  190. ```html
  191. <div class="sr-toolbar">
  192. <div class="sr-input-group"><i class="ph-duotone ph-magnifying-glass"></i><input class="sr-input" type="search" placeholder="Search" aria-label="Search"></div>
  193. <div class="sr-tabs" role="tablist" id="dir"><button class="sr-tabs__btn" role="tab" aria-selected="true" data-value="all">All</button><button class="sr-tabs__btn" role="tab" aria-selected="false" data-value="in">In</button><span class="sr-tabs__ink"></span></div>
  194. </div>
  195. <div class="sr-chips" id="types"><button class="sr-chip-btn" aria-pressed="true" data-value="">All</button><button class="sr-chip-btn" aria-pressed="false" data-value="Review"><i class="ph-duotone ph-star"></i>Reviews <span class="sr-chip-btn__n">12</span></button></div>
  196. ```
  197. Events: tabs fire `sr:tab` (`e.detail.value`), chips fire `sr:filter`. Tabs that switch panels:
  198. add `aria-controls="panelId"` and `<div class="sr-tabpanel" id="panelId">`.
  199. **Responsive table**
  200. ```html
  201. <section class="sr-panel">
  202. <div class="sr-table-wrap"><table class="sr-table">
  203. <thead><tr><th>Transaction</th><th>Type</th><th>Status</th><th class="is-num">Amount</th></tr></thead>
  204. <tbody id="rows">
  205. <tr><td class="is-main"><div class="sr-cell"><span class="sr-row__icon tone-indigo"><i class="ph-duotone ph-star"></i></span><div style="min-width:0"><p class="sr-cell__title">App review approved</p><p class="sr-cell__meta">Nov 21, 14:12 · TX332708</p></div></div></td>
  206. <td data-label="Type">Review</td><td data-label="Status"><span class="sr-badge sr-badge--dot tone-success">Completed</span></td>
  207. <td data-label="Amount" class="is-num"><span class="sr-amount is-in">+KES 150.00</span></td></tr>
  208. </tbody></table></div>
  209. <nav id="pager"></nav>
  210. </section>
  211. ```
  212. **Pagination**
  213. - Client-side list: `const list = SRPager.list('#rows', items, renderRowFn, { perPage: 10, pager: document.getElementById('pager'), empty: '<tr><td colspan="4"><div class="sr-empty">…</div></td></tr>' }); list.set(filteredItems);`
  214. - Server-side: `const pg = SRPager.mount(navEl, { total, page, perPage, onChange: (page, perPage) => load(page, perPage) }); pg.setTotal(n); pg.go(3);`
  215. - Renders "Showing 11–20 of 46", prev/next, numbers with `…`, rows-per-page select;
  216. phones get `‹ 2 / 5 ›`. The current page uses `aria-current="page"`.
  217. - Server rendered (Laravel/PHP) markup must match: `<nav class="sr-pagination">` with
  218. `.sr-pagination__info`, `.sr-pages` of `.sr-page-btn` (`.sr-page-num` on numbers,
  219. `.sr-page-gap` for …, `.sr-page-mobile` for "2 / 9"), `.sr-page-size`.
  220. - Feeds/cards may use "Load more" instead: `<div class="sr-loadmore"><button class="sr-btn sr-btn--secondary">Load more</button></div>`.
  221. **Modal → bottom sheet**
  222. ```html
  223. <button class="sr-btn sr-btn--primary" data-sr-modal-open="withdraw">Withdraw</button>
  224. <div class="sr-modal" id="withdraw" hidden role="dialog" aria-modal="true" aria-labelledby="wd-t">
  225. <form class="sr-modal__box"><span class="sr-sheet-grab"></span>
  226. <div class="sr-modal__head"><span class="sr-ic sr-ic--solid tone-brand"><i class="ph-duotone ph-wallet"></i></span><div class="sr-grow"><h2 class="sr-panel__title" id="wd-t">Withdraw</h2><p class="sr-hint">Subtitle</p></div><button type="button" class="sr-icon-btn" data-sr-modal-close aria-label="Close"><i class="ph-duotone ph-x"></i></button></div>
  227. <div class="sr-modal__body">…fields…</div>
  228. <div class="sr-modal__foot"><button type="button" class="sr-btn sr-btn--secondary sr-btn--square" data-sr-modal-close>Cancel</button><button class="sr-btn sr-btn--primary sr-btn--square">Confirm</button></div>
  229. </form>
  230. </div>
  231. ```
  232. JS: `SRModal.open(id)`, `SRModal.close(id)`; Esc and backdrop click close it.
  233. **Form extras:** `sr-select`, `sr-check` (checkbox/radio), `sr-choice` (selectable card row with
  234. a radio), `sr-amount-chips` (quick amounts using `sr-chip-btn`), `sr-steps` with
  235. `sr-step is-done|is-current`, `sr-error` (+`hidden`), `sr-input.is-invalid`, `sr-switch`.
  236. **Feedback & status:** `sr-alert tone-amber|success|danger|sky` with `sr-alert__icon/__title/__text`;
  237. `sr-progress` (`<span style="--v:72%">`) with `sr-progress-row`; `sr-ring` (`style="--v:68"`);
  238. skeletons `sr-skel sr-skel--line|--title|--circle`; `sr-empty`; `sr-badge sr-badge--dot tone-*`;
  239. `sr-avatars` group.
  240. **Notifications (toasts): always top-right** (full-width at the top on phones; max 4 on desktop, 2 on phones;
  241. newest on top). White card: tinted icon tile + title + ✕, message, optional buttons, coloured countdown bar
  242. at the bottom (pauses on hover; swipe right to dismiss on touch).
  243. ```js
  244. SRToast.success('Payout sent', 'KES 1,250 is on its way to your M-Pesa.');
  245. SRToast.warning('Verify your number', 'Confirm your M-Pesa number before your first cash-out.',
  246. { life: 0, actions: [{ label: 'Verify now', onClick: () => location.href = '/profile' }] });
  247. SRToast.error('Payment failed', 'M-Pesa did not confirm the payment. You were not charged.',
  248. { life: 0, actions: [{ label: 'Dismiss' }, { label: 'Try again', variant: 'danger', onClick: retry }] });
  249. SRToast.info('New lesson', 'Spreadsheet basics is ready.');
  250. // full form: SRToast.show({ type, title, text, life /* ms, 0 = stays */, actions: [{ label, variant: 'secondary'|'primary'|'danger', onClick, keepOpen }] })
  251. ```
  252. Success after saves/payouts, warning for things the user should do, error for failures (with a retry action),
  253. info for neutral news. Errors use `role="alert"`. Only real events; never fake activity tickers.
  254. ---
  255. ## 6b. Mobile patterns (learned from the reference app — always use these on phones)
  256. - **Top bar:** logo + one grouped pill (bell · theme · avatar). No breadcrumb on phones.
  257. - **Balance ticket:** two equal, tall buttons (`flex:1`, 50/50), dashed tear line with notches, huge amount.
  258. - **Stats:** full-width stacked gradient cards — glass icon tile · label + big value · glass pill on the right.
  259. - **Quick actions:** 5 round-square gradient tiles with labels under them.
  260. - **Rewards:** 2 roomy columns, centred coin, label, big value, sub-text.
  261. - **Drawer:** profile card first, then the nav with 40px icon chips and 16px labels.
  262. - **Tab bar:** 5 items, raised gradient CTA in the middle.
  263. - **Text sizes on phones:** body 15px, row titles 16px, card titles 17–20px, numbers 28–44px. Touch targets ≥ 44px.
  264. - Everything else is one column; nothing smaller than 12px except uppercase kickers.
  265. ## 6c. Payment / unlock sheet (gradient hero + summary ticket)
  266. Open from any button: `<button data-sr-unlock data-kind="Unlock video" data-title="Spotting fake job offers" data-fee="100" data-earn="500" data-icon="video">`.
  267. The sheet (markup in `demo/dashboard.html`, id `unlock`) has: gradient hero with dot pattern (`sr-sheet-hero`, glass
  268. close button, glass icon tile, uppercase kicker, big white title, description) → overlapping summary ticket
  269. (`sr-summary` with `sr-summary__row--head` big fee, `sr-summary__row--cut` dashed tear line, "You earn" in
  270. `sr-plus` green, payment method) → `sr-field-label` "M-PESA NUMBER" + `sr-input sr-input--lg` with phone icon →
  271. `sr-btn sr-btn--primary sr-btn--xl sr-btn--block` "Pay KES 100 via M-Pesa" → `sr-howto` numbered steps
  272. (1 Tap pay · 2 Enter your PIN · 3 Done). Validate Kenyan numbers `/^(\+?254|0)(7|1)\d{8}$/`; after the STK push
  273. request succeeds show a toast "Check your phone". Never claim a payment succeeded before your callback confirms it.
  274. ## 6d. Task cards
  275. ```html
  276. <article class="sr-task">
  277. <div class="sr-task__top"><span class="sr-ic tone-violet"><i class="sr-icon" data-icon="bot-sparkle"></i></span>
  278. <div><p class="sr-task__cat">Safety</p><p class="sr-task__time"><i class="ph ph-clock"></i>~20s</p></div>
  279. <span class="sr-reward-pill">+KES 500</span></div>
  280. <h3 class="sr-task__title">Catch the fake loan text</h3>
  281. <p class="sr-task__text">The AI judged an SMS loan offer. Did it get it right?</p>
  282. <button class="sr-btn sr-btn--outline sr-btn--square sr-btn--block sr-btn--lg" data-sr-unlock …><i class="ph ph-lock-simple"></i>Unlock task · KES 150</button>
  283. </article>
  284. ```
  285. Grid: `sr-task-list` (1 column phones, 2 columns ≥900px).
  286. ## 6e. Page hero, earnings card, levels (in-app feature pages)
  287. - **Page hero:** `<header class="sr-page-hero tone-violet">` → `sr-page-hero__top` (`sr-glyph` icon + `sr-page-hero__kicker` + `sr-page-hero__title`) + `sr-page-hero__text` + optional large faint `sr-page-hero__art` icon. Start every feature page with one.
  288. - **Gradient earnings card:** `sr-earn-card` → `sr-earn-card__top` (label, `sr-earn-card__value`, `sr-glass-pill`) + `sr-linkbox` (truncated `sr-linkbox__url`, white Copy button with `data-sr-copy`, glass share icon button).
  289. - **Level cards:** `sr-level-grid > sr-level tone-*` with `__k` (Level 1), `__v` (count), `__s` (active · amount).
  290. - Then a search `sr-input-group` and a `sr-panel` list with a count on the right, paginated.
  291. ## 6f. Cash out / withdrawal page (form pattern)
  292. 1. `sr-page-hero tone-amber` with kicker "Wallet", title "Cash Out" and a full-width secondary "History" button.
  293. 2. Balance card: `sr-bal-card__head` (`sr-ic sr-ic--solid` + `sr-field-label` "Available balance"),
  294. `sr-bal-card__amount`, then `<dl class="sr-split-stats">` with Min amount / Max payout.
  295. 3. Form card: label → `sr-affix` input (`sr-affix__pre` "KES", `sr-affix__post` MAX button) →
  296. `sr-pct-chips` (25% · 50% · 75%) → `sr-label-row` with label + `sr-verified` → read-only `sr-input[readonly]`
  297. phone → `sr-receipt` rows (Amount to receive · Estimated fee · Arrives/Total with `is-total`) →
  298. `sr-btn--primary sr-btn--xl sr-btn--block`.
  299. 4. Recalculate the receipt live on input; validate min/max; use `SRButton.run` on submit.
  300. Two columns on desktop (`sr-split`), one column on phones. Full markup: `demo/transactions.html`.
  301. ## 6g. Auth pages — login · register · forgot password
  302. Reference: `demo/login.html`, `demo/register.html`, `demo/forgot.html`. Every project gets all three.
  303. - Layout `sr-auth`: theme toggle top-right (`sr-auth__theme`), centred logo, one big white card
  304. (`sr-auth__card`, radius 2rem) with optional gradient icon badge (`sr-auth__badge`), huge bold title
  305. (`sr-auth__title`, e.g. "Welcome back" / "Create your account"), muted subtitle (`sr-auth__sub`), form, divider
  306. (`sr-divider` "New to APP?"), soft secondary block button, and a muted footer line (`sr-auth__foot`).
  307. - On ≥1024px a gradient brand panel (`sr-auth__aside`) with headline, text and 3 benefit rows sits on the left.
  308. - Inputs: `sr-input sr-input--soft` inside `sr-input-group` with a leading Phosphor icon (user, lock, device-mobile, gift);
  309. phone numbers add `sr-input--mono`. Passwords: wrap in `sr-pass` + eye button `data-sr-eye="inputId"`;
  310. register adds `<div class="sr-strength" data-sr-strength="inputId"><span></span>×4</div>`.
  311. - Label row with right-aligned `sr-link` ("Forgot password? →"). Helper text `sr-hint` under the field.
  312. - Errors: `sr-input.is-invalid` + `<span class="sr-error" id="FIELD-err">` under the field; shake the submit button.
  313. - Primary action: `sr-btn sr-btn--primary sr-btn--xl sr-btn--block sr-btn--arrow` with `ph-arrow-right`; run it with `SRButton.run`.
  314. - Register: username (3–32 chars `[A-Za-z0-9._-]`), M-Pesa phone, password (min 6) + strength, optional referral
  315. code (prefill from `?ref=`), terms checkbox. Forgot: steps Phone → Code → New password with `sr-steps`.
  316. - Correct `autocomplete` values (`username`, `current-password`, `new-password`, `tel`, `one-time-code`) and `inputmode`.
  317. - Never reveal whether an account exists on the forgot page; rate-limit login and reset on the server.
  318. - **Must fit one phone screen with no scrolling** at 412×760 and 360×640 (measured). How: logo left + theme button
  319. on one row, badge hidden on phones, card padding 1.375rem, inputs 3.125rem, helper text only on focus
  320. (`sr-hint--focus`), optional fields collapsed behind a link (e.g. "Have a referral code?"), a one-line
  321. `sr-legal` consent text instead of a checkbox, footer hidden on phones, and on register the bottom
  322. divider + button replaced by one `sr-auth__alt` line (`sr-auth--compact-alt`).
  323. - **General compactness rule for every page:** primary action visible without scrolling on a 412×760 screen;
  324. forms ≤ 5 visible fields on phones (collapse optional ones); use `hidden` (the kit forces `[hidden]{display:none}`).
  325. ## 6h. EXACT card markup — copy, never invent (v5)
  326. AI tools broke real sites by writing their own card markup. **Use these blocks exactly. Do not write custom CSS for cards.**
  327. **Stat strip** (DreamWork "Today / Withdrawn / Lifetime"; also admin counters). One horizontal row on every screen: glass icon on the left, label and value in the middle, pill on the right. **The icon is never above the label.**
  328. ```html
  329. <section class="sr-stats sr-stats--row">
  330. <div class="sr-stat tone-sky">
  331. <span class="sr-stat__icon"><i class="sr-icon" data-icon="people"></i></span>
  332. <div class="sr-stat__body"><p class="sr-stat__label">Candidates</p><p class="sr-stat__value"><small>KES</small>117,500</p></div>
  333. <span class="sr-stat__hint">+4 this week</span>
  334. <span class="sr-stat__spark">✦</span>
  335. </div>
  336. </section>
  337. ```
  338. **Reward card** (2-column grid: coin with halo, centred label, value, sub): see `.sr-reward-grid` in `demo/dashboard.html`.
  339. **Module row** (admin modules, categories; replaces big tiles in admin panels):
  340. ```html
  341. <div class="sr-modules"><a href="#" class="sr-module tone-violet"><span class="sr-glyph"><i class="sr-icon" data-icon="person-key"></i></span>
  342. <div><p class="sr-module__k">Officers, roles</p><p class="sr-module__t">Staff &amp; roles</p><p class="sr-module__s">5 active staff</p></div>
  343. <span class="sr-module__go"><i class="ph ph-caret-right"></i></span></a></div>
  344. ```
  345. **Page head with buttons** (never put buttons inside the title row yourself):
  346. ```html
  347. <header class="sr-page-head tone-rose"><span class="sr-glyph"><i class="sr-icon" data-icon="people-community"></i></span>
  348. <div><p class="sr-page-head__kicker">Partners</p><h1 class="sr-page-head__title">Partners &amp; commissions</h1></div>
  349. <p class="sr-page-head__text">One-line description.</p>
  350. <div class="sr-page-head__actions"><button class="sr-btn sr-btn--primary sr-btn--square">Add partner</button><button class="sr-btn sr-btn--secondary sr-btn--square">Rules</button></div></header>
  351. ```
  352. **Numbers grid** (2×2 on phones, 4 across on desktop; numbers never wrap): `.sr-metrics.sr-metrics--4 > .sr-metric > .sr-metric__k + .sr-metric__v(<small>KES</small>3,950)`.
  353. **Callout with action**: `.sr-callout.tone-amber > .sr-ic + .sr-callout__t + .sr-callout__s + a.sr-btn.sr-callout__a`.
  354. **Public (logged-out) header**: `.sr-site-head > .sr-site-head__bar` with logo, `.sr-site-head__nav`, `.sr-site-head__right` (theme toggle, `.sr-site-head__signin`, `.sr-site-head__cta`, `.sr-site-head__burger`). See `demo/public.html`.
  355. **Search + filters**: `.sr-search` (stacked on phones, one bar on desktop) followed by `.sr-filter-row > label.sr-filter > select + i.ph-caret-down` (scrolls sideways on phones, never cut off).
  356. **Forms**: Yes/No choices use `.sr-pills > label.sr-pill > input[type=radio] + span`. File uploads use `label.sr-upload` (input, `.sr-upload__thumb`, text; preview is automatic). Multi-step forms end with `.sr-step-foot` (Back · Step 2 of 4 · Continue).
  357. ## 6i. Known pitfalls (these caused real bugs — never do them)
  358. - Never set `position:relative` on every child of a button or card. It drags the tap ripple into the layout and cards jump on click. The kit already handles stacking.
  359. - Never write `.sr-stat{flex-direction:column}` or put the icon box above the stat label.
  360. - Never put huge background icons behind text. `.sr-tile__ghost` is pinned bottom-right at 7% opacity; leave it there.
  361. - Never put two buttons in the same flex row as a long title. Use `.sr-page-head__actions`, which drops below the title on phones.
  362. - Money and numbers (`KES 3,950`) must never break across lines. Use `.sr-stat__value`, `.sr-metric__v` or `.sr-money`, which are already nowrap.
  363. - Every flex or grid child that holds text needs `min-width:0`. Use `.sr-grow`.
  364. - Never make the topbar or tabbar more see-through than the kit's defaults.
  365. - Rows of selects or chips must scroll (`.sr-filter-row`) or wrap. They must never sit at fixed widths.
  366. - Test: open any page with `?sr-debug` in the URL. Anything wider than the screen is outlined red and a toast reports the count. Fix every one.
  367. ## 6j. Account menu — Log out is COMPULSORY (every signed-in page)
  368. The top-right avatar pill opens the account menu. Every signed-in page must have it, and it must end with **Log out**. Never put this menu inside an element with `overflow:hidden`; the kit keeps the top bar `overflow:visible` for this.
  369. ```html
  370. <button class="sr-account" data-sr-pop="pop-account" aria-label="Account menu" aria-expanded="false"><span class="sr-avatar sr-avatar--sm">DA</span><span class="sr-account__name">dalitech</span><i class="ph ph-caret-down sr-muted"></i></button>
  371. <div class="sr-popover sr-popover--account" id="pop-account" hidden>
  372. <div class="sr-menu-head"><span class="sr-menu-head__avatar">DA</span><span class="sr-grow"><span class="sr-menu-head__name">dalitech</span><span class="sr-menu-head__meta">+254718308478</span></span></div>
  373. <div class="sr-menu-sep"></div>
  374. <a href="/profile" class="sr-menu-item"><i class="ph ph-user"></i>Profile &amp; security</a>
  375. <a href="#" class="sr-menu-item" data-install><i class="ph ph-download-simple"></i>Install app</a>
  376. <div class="sr-menu-sep"></div>
  377. <form method="post" action="/logout"><button class="sr-menu-item sr-menu-item--danger"><i class="ph ph-sign-out"></i>Log out</button></form>
  378. </div>
  379. ```
  380. Log out must be a POST (with your CSRF token) that ends the session server-side, then redirects to the login page.
  381. ## 6k. DreamWork phone type scale (exact; do not enlarge)
  382. These sizes were measured from dreamwork.co.ke on a 412 px-wide phone and are built into `sunrise.css` (sections 62–64). Use the kit classes; never override font sizes on phones.
  383. | Text | px | Text | px |
  384. |---|---|---|---|
  385. | Top bar brand | 14 | Greeting / page title | 20 |
  386. | Greeting date, labels, hints | 12.5 | Balance amount | 34 |
  387. | Stat strip label / value | 15 / 23.5 | Task card kicker / title / sub | 9 / 15 / 11 |
  388. | Reward card label / value / sub | 12.5 / 18 / 11 | Menu, drawer and list rows | 13 |
  389. | Panel titles | 14.5 | Bottom bar labels | 9.5 |
  390. | Login title / subtitle / labels | 25.5 / 13 / 11.5 | Inputs and buttons | 14.5 |
  391. Element sizes: top bar 51, icon tiles 44, stat icon 36, bottom bar 55, drawer 240 wide with 40 px rows, inputs 41, auth buttons 43.
  392. **Verify:** `python3 tools/dw_measure.py <demo folder>` checks 65 measurements, and `python3 tools/qa.py <folder> <pages>` checks overflow, overlapping or cut-off text, and size changes on tap at 360/390/412/768/1440 px. Both must report 0.
  393. ## 7. Layout components (see demo pages for full markup)
  394. Greeting `sr-greet` · balance ticket `sr-balance` (+ sun SVG) · solid stats `sr-stats > sr-stat tone-*`
  395. · phone shortcuts `sr-quick` · section head `sr-head` with `sr-kicker` + `sr-title` + `sr-pill-link`
  396. · feature tiles `sr-tile-grid > sr-tile tone-*` (ghost icon, `sr-glyph`, tag/name/desc, `sr-tile__foot`, `sr-go`)
  397. · reward coins `sr-reward-grid > sr-reward tone-*` · panels `sr-panel` with `sr-panel__head/__body` and `sr-row`
  398. · KPI strip `sr-kpis > sr-kpi` · media cards `sr-media-grid > sr-media` (thumb, lock, chips, body, button)
  399. · unlock card `sr-lock` + `sr-fee` · profile `sr-profile`, `sr-copybox`, `sr-dl`
  400. · forms `sr-field`, `sr-label`, `sr-input`, `sr-input-group`, `sr-hint`.
  401. Money: `<p class="sr-money"><small>KES</small>12,480.50</p>`; ledger amounts `sr-amount is-in|is-out` (mono).
  402. Buttons: `sr-btn` + `--primary | --soft | --outline | --secondary | --ghost | --danger`, `--sm | --lg`,
  403. `--square` (forms/cards) vs pill (hero actions), `--block`, `--icon`.
  404. ---
  405. ## 8. Premium frontend standards (apply on every project)
  406. - **Typography:** Sora 700–800 for headings/numbers (negative tracking), Inter body, JetBrains
  407. Mono for ledgers/codes. Small caps labels: uppercase 0.62–0.7rem, 700, 0.12–0.16em tracking.
  408. - **Spacing rhythm:** sections `gap:1.75rem` (kit `sr-page`), cards padding 1–1.25rem, inner gaps .5/.75/1rem.
  409. - **Hierarchy per screen:** one primary action (gradient button), secondary actions soft/outline.
  410. - **Content:** realistic copy and numbers, `tabular-nums`, consistent currency, relative + absolute dates.
  411. - **Performance:** preconnect fonts; `loading="lazy"` + `width/height` on images; `aspect-ratio` on
  412. media; defer non-critical JS; no layout shift (skeletons match final size); compress images (WebP/AVIF).
  413. - **SEO & meta:** unique `<title>` and `<meta name="description">` per page, Open Graph tags,
  414. favicon + `apple-touch-icon`, `theme-color`, semantic landmarks (`header`, `nav`, `main`, `section`, `aside`).
  415. - **PWA (optional):** manifest + install toast via `SRToast.info('Install the app', 'Open it from your home screen.', {life:0, actions:[{label:'Install', variant:'primary', onClick: install}]})`.
  416. - **Forms:** inline validation on blur/submit, clear error text, disable double submit (`SRButton.run`),
  417. correct `autocomplete` and `inputmode`, success toast after save.
  418. - **States:** loading skeleton, empty with icon + next action, error alert with retry, success toast.
  419. - **Security:** escape all user content in templates; JSON-encode server data into scripts; CSRF tokens on POST.
  420. - **Consistency:** reuse existing classes before writing new CSS; if new CSS is needed, use kit tokens only.
  421. ---
  422. ## 9. Saving the admin theme (backend)
  423. Validate `brand|brand2|brand3` as `/^#[0-9a-f]{6}$/i`, `radius` 0.6–1.4, `font` in
  424. `sora|jakarta|grotesk|system`. Store one JSON value, print into `window.SR_THEME`.
  425. *Laravel*
  426. ```php
  427. Route::post('/admin/theme', function (Illuminate\Http\Request $r) {
  428. $d = $r->validate(['brand'=>['regex:/^#[0-9a-fA-F]{6}$/'],'brand2'=>['regex:/^#[0-9a-fA-F]{6}$/'],'brand3'=>['regex:/^#[0-9a-fA-F]{6}$/'],
  429. 'radius'=>'numeric|between:0.6,1.4','font'=>'in:sora,jakarta,grotesk,system','preset'=>'string|max:20','allowUserColors'=>'boolean']);
  430. \DB::table('settings')->updateOrInsert(['key'=>'theme'],['value'=>json_encode($d)]); cache()->forget('theme');
  431. return response()->noContent();
  432. })->middleware(['auth','can:admin']);
  433. // layout.blade.php
  434. <script>window.SR_THEME = {!! cache()->rememberForever('theme', fn() => \DB::table('settings')->where('key','theme')->value('value') ?? '{}') !!};</script>
  435. ```
  436. *Plain PHP:* `file_put_contents('theme.json', json_encode($clean));` →
  437. `<script>window.SR_THEME=<?= @file_get_contents('theme.json') ?: '{}' ?>;</script>`.
  438. *Node/Express:* `app.post('/admin/theme', requireAdmin, (q,s)=>{ db.set('theme', clean(q.body)); s.sendStatus(204) })`
  439. → `window.SR_THEME = <%- JSON.stringify(theme) %>`.
  440. ---
  441. ## 10. Delivery checklist
  442. - [ ] Top-right avatar menu with **Log out** on every signed-in page (§6j)
  443. - [ ] Phone text sizes untouched from the kit scale (§6k); `dw_measure.py` → OFF: 0
  444. - [ ] Stat cards use the exact 6h markup (horizontal strip, never icon-on-top)
  445. - [ ] Page opened with `?sr-debug` at 360 px shows "No overflow"
  446. - [ ] Tapping any card or button does not change its size
  447. - [ ] Head order correct; duotone icon CSS loaded; `sunrise-ui.js` at end of body.
  448. - [ ] Same shell on every page, active nav + tab bar item set, breadcrumb title updated.
  449. - [ ] Checked at 360 / 390 / 768 / 1024 / 1440 px — no horizontal scroll, nothing clipped.
  450. - [ ] Light + dark + one other preset look right.
  451. - [ ] Feature icons are `sr-icon` colour icons in glass tiles; small controls use `ph`; nothing rotated; sidebar links have tones.
  452. - [ ] Login, register and forgot-password pages exist and match `demo/`.
  453. - [ ] Clean white cards with clearly readable text in light; dark mode checked; glass only on chrome unless `sr-glass` was requested.
  454. - [ ] Every button/tile gives feedback; async actions use `SRButton.run`.
  455. - [ ] Lists paginated; tables have `data-label`; loading/empty/error states exist.
  456. - [ ] Modals become bottom sheets on phones and close with Esc/backdrop.
  457. - [ ] Theme Studio wired for admins (`saveUrl`) and validated server-side.
  458. - [ ] Notifications/toasts use real data only.
README.md · README · 58 lines
  1. # Sunrise UI Kit v4
  2. A premium, theme-driven dashboard design system. Clean white cards with high-contrast text, gradient stat cards,
  3. Heroicons (plus 4 switchable icon libraries), payment bottom sheets, task cards, cash-out forms, responsive tables,
  4. pagination, light and dark mode, and a **Theme Studio** where an admin changes the whole colour scheme live.
  5. No framework, no build step: 4 files.
  6. | Login | Register | Home | Cash out | Pay sheet | Referrals | Dark |
  7. |---|---|---|---|---|---|---|
  8. | ![](screenshots/mobile-login.jpg) | ![](screenshots/mobile-register.jpg) | ![](screenshots/mobile-home.jpg) | ![](screenshots/mobile-cash-out.jpg) | ![](screenshots/mobile-pay-sheet.jpg) | ![](screenshots/mobile-referrals.jpg) | ![](screenshots/mobile-home-dark.jpg) |
  9. ![Desktop dashboard](screenshots/desktop-dashboard.jpg)
  10. ![Cash out](screenshots/desktop-cash-out.jpg)
  11. ![Login](screenshots/desktop-login.jpg)
  12. ![Notifications](screenshots/desktop-notifications.jpg)
  13. ## Quick start
  14. Open `demo/login.html` (or `demo/dashboard.html`) in a browser (sidebar → Admin → Theme studio to recolour).
  15. **Check any page for layout bugs:** add `?sr-debug` to its URL. Anything wider than the screen is outlined red. Automated check of every demo page at 5 widths: `python3 tools/qa.py "$PWD/demo" admin,public,dashboard,login` (needs Playwright).
  16. ```html
  17. <head>
  18. <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
  19. <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap">
  20. <link rel="stylesheet" href="https://unpkg.com/@phosphor-icons/web@2.1.1/src/regular/style.css">
  21. <link rel="stylesheet" href="kit/sunrise.css">
  22. <script>window.SR_THEME = { preset: "ember", icons: "heroicons" };</script>
  23. <script src="kit/sunrise-theme.js"></script>
  24. </head>
  25. <body>
  26. … shell from demo/dashboard.html …
  27. <script src="kit/sunrise-icons.js"></script>
  28. <script src="kit/sunrise-ui.js"></script>
  29. </body>
  30. ```
  31. Change colours without JS: `:root{--brand:#2563eb;--brand-2:#38bdf8;--brand-3:#7c3aed}`.
  32. Presets: `ember`, `ocean`, `emerald`, `royal`, `rose`, `cobalt`, `gold`, `graphite`.
  33. Icon libraries: `heroicons` (default), `fluent`, `lucide`, `tabler`, `fontawesome`.
  34. ## What's inside
  35. | Path | What |
  36. |---|---|
  37. | `kit/` | `sunrise.css` (design system), `sunrise-theme.js` (themes, dark mode, admin config), `sunrise-icons.js` (5 icon libraries, inline SVG), `sunrise-ui.js` (ripple, sheets, tabs, pagination, toasts, Theme Studio) |
  38. | `demo/` | `login.html`, `register.html`, `forgot.html`, `dashboard.html`, `transactions.html` (cash out + pagination), `pages.html` (lessons, tasks, referrals, account), `admin.html` (admin panel: stat strips, modules, page heads with buttons, metrics), `public.html` (logged-out header, search, filters, Yes/No pills, upload, step form) |
  39. | `SKILL.md` | Full rules: responsive, icons, motion, components, mobile patterns, backend theme saving, checklist |
  40. | `AGENTS.md` | Instructions any AI coding tool should follow (also `CLAUDE.md`, `GEMINI.md`, `.cursor/rules`, `.windsurfrules`, `.github/copilot-instructions.md`) |
  41. | `skills/sunrise-dashboard-ui/` | The same rules packaged as a Claude skill |
  42. | `tools/` | `build-icons.py` + `icon_map.py` to add icons or trim the bundle |
  43. | `screenshots/` | Mobile and desktop previews |
  44. ## Using it with AI tools
  45. Paste the repo link and say what to build, e.g.
  46. *"Using https://github.com/YOU/sunrise-ui-kit, build my loans admin panel with users, payments and settings pages."*
  47. Tools that read repo instruction files (Claude Code, Cursor, Copilot, Windsurf, Gemini CLI, Codex) pick up the rules automatically.
  48. ## License
  49. MIT for the kit. Bundled icons keep their own licenses — see `THIRD_PARTY_NOTICES.md`.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.