Design system v1 (F1)
Tradey styleguide
Every component in src/UI/functions/ with its states and the PHP call that renders it. Tokens live in src/styles/_tokens.scss; full API in docs/design-system.md.
Logo
Roof-pitch T: a roofline that doubles as the crossbar of a T. Keep clear space of half the icon height; never recolour, stretch or add effects.
tradey-logo-light.svg Lockup, light backgroundstradey-logo-dark.svg Lockup, dark backgroundstradey-wordmark-light.svg Wordmark, lighttradey-wordmark-dark.svg Wordmark, darktradey-icon-light.svg at 64, 32, 16pxtradey-icon-dark.svg at 64, 32, 16pxColour
Brand
Neutrals (warm concrete)
Status
Contrast pairs in use
WCAG 2.x AA: 4.5:1 for normal text, 3:1 for large text and UI graphics. Calculated on this page from the hex values.
| Sample | Foreground on background | Used for | Ratio | Needs | Result |
|---|---|---|---|---|---|
| Aa Tradey | white on primary | Primary button text | 8.29:1 | 4.5:1 | Pass AA |
| Aa Tradey | white on primary-hover | Primary button hover | 10.65:1 | 4.5:1 | Pass AA |
| Aa Tradey | primary on white | Links on white | 8.29:1 | 4.5:1 | Pass AA |
| Aa Tradey | primary on n50 | Links on page background | 7.67:1 | 4.5:1 | Pass AA |
| Aa Tradey | white on ink | Text on header/footer/hero | 15.12:1 | 4.5:1 | Pass AA |
| Aa Tradey | n200 on ink | Muted text on ink | 10.74:1 | 4.5:1 | Pass AA |
| Aa Tradey | ink on accent | CTA button text | 4.93:1 | 4.5:1 | Pass AA |
| Aa Tradey | ink on accent-hover | CTA button hover | 6.21:1 | 4.5:1 | Pass AA |
| Graphic sample | accent on ink | Orange eyebrow / focus ring on ink | 4.93:1 | 3.0:1 | Pass AA |
| Aa Tradey | accent-text on white | Orange text on white | 5.42:1 | 4.5:1 | Pass AA |
| Aa Tradey | accent-text on accent-tint | Accent badge | 4.67:1 | 4.5:1 | Pass AA |
| Aa Tradey | n900 on white | Body text on white | 17.36:1 | 4.5:1 | Pass AA |
| Aa Tradey | n900 on n50 | Body text on page background | 16.07:1 | 4.5:1 | Pass AA |
| Aa Tradey | n600 on white | Secondary text on white | 7.16:1 | 4.5:1 | Pass AA |
| Aa Tradey | n600 on n50 | Secondary text on page background | 6.63:1 | 4.5:1 | Pass AA |
| Aa Tradey | n600 on n100 | Secondary text on sunken surface | 6.07:1 | 4.5:1 | Pass AA |
| Graphic sample | n400 on white | Input border (non-text, 3:1) | 3.47:1 | 3.0:1 | Pass AA |
| Aa Tradey | primary on primary-tint | Info alert / primary badge | 7.10:1 | 4.5:1 | Pass AA |
| Aa Tradey | success on white | Success text | 5.38:1 | 4.5:1 | Pass AA |
| Aa Tradey | success on success-tint | Success alert | 4.67:1 | 4.5:1 | Pass AA |
| Aa Tradey | warning on white | Warning text | 6.33:1 | 4.5:1 | Pass AA |
| Aa Tradey | warning on warning-tint | Warning alert | 5.78:1 | 4.5:1 | Pass AA |
| Aa Tradey | n900 on warning-fill | Text on warning fill | 9.37:1 | 4.5:1 | Pass AA |
| Aa Tradey | danger on white | Error text | 6.57:1 | 4.5:1 | Pass AA |
| Aa Tradey | danger on danger-tint | Danger alert | 5.59:1 | 4.5:1 | Pass AA |
| Aa Tradey | white on danger | Danger button text | 6.57:1 | 4.5:1 | Pass AA |
| Graphic sample | accent on white | Logo roof on white (graphic, 3:1) | 3.06:1 | 3.0:1 | Pass AA |
| Graphic sample | primary on n50 | Focus ring on light surfaces (3:1) | 7.67:1 | 3.0:1 | Pass AA |
Type
Archivo (headings, buttons, labels) with Source Sans 3 (body). Both SIL OFL 1.1, self-hosted. Body is 17px.
t('5xl')60px / Archivo 800 · Hero (desktop)
Fix it right
t('4xl')48px / Archivo 800 · h1
Leads that call back
t('3xl')38px / Archivo 800 · h2
Book more jobs
t('2xl')30px / Archivo 800 · h2 mobile, big numbers
Simple pricing
t('xl')24px / Archivo 700 · h3, card titles
Forms and CRM
t('lg')20px / Source Sans 3 · lead
One login for your website, leads, schedule and invoices.
t('base')17px / Source Sans 3 400 · body
Every quote request lands in one list. Bold 700, italic, link.
t('sm')15px / Source Sans 3 · help, meta
Helper text: we only use your phone number to confirm jobs.
t('xs')13px / Source Sans 3 · fine print
© 2026 Tradey.com. Legal and captions.
Buttons
ui\button(): <button> by default, <a> when given href. 48px tall (44px small). One accent CTA per view.
Variants
PHP
ui\button('Accent CTA', ['variant' => 'accent']);
ui\button('Delete job', ['variant' => 'danger']);
ui\button('Disabled', ['disabled' => true]);Sizes, icons, links
Icon-only buttons keep their text for screen readers.
PHP
ui\button('Request a call', ['icon' => 'phone', 'href' => '/request-a-call/']);
ui\button('Add customer', ['icon' => 'plus', 'icon_only' => true]);On dark
PHP
ui\button_row([ui\button('Try the live demo', ['variant' => 'accent', 'href' => '/demo/']), ui\button('On dark', ['variant' => 'on-dark'])]);Full width on phones
button_row with stack_sm: buttons stack full width under 480px.
PHP
ui\button_row([...], ['stack_sm' => true]);Form controls
Every control has a visible label, help and error text wired with aria-describedby, and an id generated if you do not pass one.
Text input
Types: text, email, tel, password, number, search, url, date.
PHP
ui\input('phone', 'Mobile phone', ['type' => 'tel', 'autocomplete' => 'tel',
'help' => 'We text you when a new lead comes in.']);
ui\input('zip', 'Service area ZIP', ['value' => '945', 'error' => 'Enter a 5-digit ZIP code.']);Prefix, suffix, icon, states
PHP
ui\input('price', 'Job price', ['prefix' => '$']);
ui\input('subdomain', 'Site address', ['suffix' => '.tradey.com']);
ui\input('find', 'Search customers', ['type' => 'search', 'icon' => 'search']);
ui\input('locked', 'Plan', ['disabled' => true]);Select and textarea
PHP
ui\select('trade', 'Trade', $trades, ['placeholder' => 'Choose your trade', 'required' => true]);
ui\select('time', 'Best time', ['Weekdays' => ['am' => 'Morning']], ['value' => 'am']);
ui\textarea('details', 'Job details', ['rows' => 3, 'optional' => true]);Checkbox, radios, toggle
Toggle is a checkbox with role="switch".
PHP
ui\checkbox('sms', 'Text me appointment reminders', ['checked' => true]);
ui\radios('method', 'How should we build your site?', ['ai' => ['AI interview', 'hint'], ...], ['value' => 'ai']);
ui\toggle('booking', 'Online booking', ['checked' => true, 'on_label' => 'On', 'off_label' => 'Off']);Upload
Native file input under a drop zone; chosen file names are announced.
PHP
ui\upload('logo', 'Business logo', ['accept' => 'image/png,image/jpeg', 'help' => 'PNG or JPG, up to 5 MB.']);Form and actions
Wireframe forms post to the next page in the flow (no backend).
PHP
ui\form(['action' => '/signup/verify-email/'], [
ui\input('email', 'Work email', ['type' => 'email', 'required' => true]),
ui\actions([ui\button('Create account', ['type' => 'submit'])]),
]);Cards and stats
Cards
ui\card(): title, icon, eyebrow, badge, footer, href (whole card clickable), variant (accent|muted|flat).
Basic card
White surface, 1px border, 14px radius, small shadow.
The whole card is clickable; the border turns blue on hover.
Accent card
Orange top rule for one highlighted item. Use sparingly.
Website
riverabrosroofing.com
Published Nov 26. 4 pages, 2 forms.
Muted card
For secondary information, side notes and tips.
PHP
ui\card(['icon' => 'calendar', 'title' => 'Link card', 'href' => '/console/scheduling/'], 'Text...');
ui\card(['title' => 'riverabrosroofing.com', 'badge' => ui\badge('Live', 'success', ['dot' => true]),
'footer' => [ui\button('Open builder', ['href' => '...', 'size' => 'sm'])]], 'Published Nov 26.');Stats
ui\stat(): KPI tiles for dashboards. trend colours the delta.
PHP
ui\stat('New leads', '18', ['icon' => 'inbox', 'delta' => '+4 this week', 'trend' => 'up', 'href' => '/console/inbox/']);Tables
ui\table(): columns map keys to labels or render callbacks. Row links make the whole row clickable; the first cell holds the real link for keyboards.
Clickable rows, sorted column
Rows come from config/fixtures/customers.php.
| Customer | Phone | City | Status | Value | Last contact |
|---|---|---|---|---|---|
| Dana Martinez | (925) 555-0142 | Danville | New lead | $1,850 | Today, 3:42 PM |
| Greg Holloway | (925) 555-0178 | San Ramon | Quoted | $12,400 | Yesterday |
| Priya Natarajan | (925) 555-0113 | Walnut Creek | Scheduled | $640 | Nov 25 |
| Tom & Ellen Baker | (925) 555-0190 | Alamo | In progress | $18,900 | Nov 24 |
| Luis Ortega | (925) 555-0127 | Danville | Paid | $975 | Nov 21 |
| Hannah Cho | (925) 555-0165 | Dublin | Lost | — | Nov 18 |
| Rita Gomez | (925) 555-0133 | San Ramon | In progress | $1,200 | Nov 1 |
| Marcus Lee | (925) 555-0151 | Danville | Paid | $2,860 | Oct 28 |
PHP
ui\table($columns, Fixtures::all('customers'), [
'caption' => 'Customers',
'row_href' => fn ($r) => '/console/customers/customer/?id=' . $r['id'],
'sort' => ['key' => 'last', 'dir' => 'desc'],
]);
ui\pagination(1, 7, '/console/customers/?page=', ['summary' => 'Showing 1–6 of 41 customers']);Stacked on phones, dense
stack => true turns rows into label/value cards under 768px.
PHP
ui\table($cols, $rows, ['caption' => 'Recent invoices', 'stack' => true, 'dense' => true]);Empty
Pass empty => ui\empty_state() for lists without rows.
No quotes yet
Send your first quote from a job or customer. It turns into an invoice when they accept.
PHP
ui\table($cols, [], ['empty' => ui\empty_state(['icon' => 'quote', 'title' => 'No quotes yet', 'action' => ...])]);Loading
Announced once as "Loading" to screen readers.
PHP
ui\skeleton(['variant' => 'table', 'rows' => 4, 'label' => 'Loading customers']);Badges, chips, avatars, progress, details
Badges
Tones: neutral, primary, accent, success, warning, danger.
DraftScheduledNew leadPaidDue soonOverdueLiveOffline
PHP
ui\badge('Paid', 'success');
ui\badge('Live', 'success', ['dot' => true]);Chips
Filter or category links; current gets aria-current.
PHP
ui\chips(['All' => '/console/customers/', 'Quoted' => '/console/customers/?status=quoted'], ['current' => '/console/customers/']);Avatars
Initials with an accessible name.
PHP
ui\avatar('Dana Martinez', ['size' => 'md', 'tone' => 'primary']);Progress
PHP
ui\progress(3, 5, 'Website setup');Description list
Record details. columns => 2 on desktop.
- Customer
- Dana Martinez
- Phone
- (925) 555-0142
- Source
- Website form
- Status
- New lead
PHP
ui\dl(['Customer' => 'Dana Martinez', 'Status' => ui\badge('New lead', 'accent')]);Page header
Title block with breadcrumbs and actions for every app page.
Dana Martinez New lead
Leak repair · Danville
PHP
ui\page_header('Dana Martinez', [
'breadcrumbs' => ['Customers' => '/console/customers/', 'Dana Martinez' => null],
'badge' => ui\badge('New lead', 'accent'), 'actions' => [ui\button('New quote', [...])],
]);Alerts and states
Alerts
danger uses role="alert"; the others role="status". Optional title, actions and dismiss button.
Your site is a draft until you publish it. You approve every publish.
riverabrosroofing.com is published.
Add a card before your free month ends, or your site goes offline.
We could not charge your card. Your site goes offline in 3 days.
PHP
ui\alert('Add a card before your free month ends.', [
'tone' => 'warning', 'title' => '19 days left',
'actions' => [ui\button('Add a card', ['href' => '/console/billing/payment-methods/', 'size' => 'sm'])],
]);Banners
Full-width strips at the top of a shell (Layout option banner).
PHP
ui\banner('You are in the demo...', ['tone' => 'accent', 'icon' => 'eye', 'action' => ui\button(...)]);Empty state
No appointments this week
Share your booking page so customers can pick a time.
PHP
ui\empty_state(['icon' => 'calendar', 'title' => 'No appointments this week', 'body' => '...', 'action' => ui\button(...)]);Loading
Saving changes
PHP
ui\skeleton(['lines' => 3]);
ui\spinner('Saving changes');Modals
ui\modal() renders a native <dialog>: focus moves in, Tab stays inside, Escape closes, focus returns to the opener.
Dialogs
PHP
ui\button('Publish site', ['opens' => 'publish']);
ui\modal('publish', 'Publish riverabrosroofing.com?', $body, [
'actions' => [ui\button('Cancel', ['closes' => true, 'variant' => 'ghost']), ui\button('Approve and publish', ['href' => '...'])],
]);
ui\modal('add', 'Add a customer', [ui\input(...)], ['form' => ['action' => '/console/customers/customer/?id=1'], 'actions' => [...]]);Marketing components
Used by the home page. ui\hero() is the dark band at the top of the home page.
Site preview
Always labelled "Example site" so sample copy is never read as a claim.
PHP
ui\site_preview(['domain' => '...', 'title' => '24/7 plumbing repairs', 'cta' => 'Book a visit']);Price card
$20 /month per live website
- AI website builder and hosting
- Forms, CRM and scheduling
PHP
ui\price_card(['badge' => 'First month free', 'amount' => '$20', 'period' => '/month per live website', 'features' => [...], 'actions' => [...]]);Callout
PHP
ui\callout(['eyebrow' => '...', 'title' => '...', 'body' => '...', 'actions' => [...]]);Page sections
Added in F2 for the public site (src/UI/functions/marketing.php, content.php, forms.php). ui\page_hero() (the h1 band of every inner page, light or ink) and ui\cta_band() (closing call to action) are full-width, so see them on Pricing and Roofing. ui\error_hero() (F10) is the band of the 403, 404 and 500 pages.
Feature row
Copy beside media; reverse flips sides on desktop; stacks on mobile.
Scheduling
Customers book into the slots you choose.
Sample lead copy.
- Booking pages on your site
- One calendar
PHP
ui\feature_row(['eyebrow' => 'Scheduling', 'icon' => 'calendar', 'title' => '...', 'lead' => '...', 'points' => [...],
'media' => ui\app_preview([...], ...), 'reverse' => false]);App preview
A framed, inert mock of the app built from real components; always badged "Example data". Screen readers get the description only.
PHP
ui\app_preview(['title' => 'CRM: Customers', 'description' => 'Example customer list'], ui\table(...));Steps
Numbered ordered list; icon replaces the number when given.
Step 1: Answer a few questions
AI drafts your site.
Step 2: Review and edit
Step 3: You approve the publish
PHP
ui\steps([['title' => '...', 'text' => '...'], ...], ['cols' => 3]);Timeline
Vertical sequence with a tone per step (free month, what happens next).
Day 1
Site goes live
Before the month ends
Add a card
No card
Site goes offline
PHP
ui\timeline([['label' => 'Day 1', 'title' => '...', 'tone' => 'success'], ...]);Accordion
Native <details>: keyboard and no-JS friendly.
Can I cancel anytime?
Sample answer.
Do I need a card to start?
Sample answer.
PHP
ui\accordion([['q' => '...', 'a' => '...', 'open' => false], ...], ['heading_tag' => 'h3']);Side nav
Section menu for document pages; marks the current item with aria-current.
PHP
ui\side_nav(['/legal/terms/' => 'Terms of service', ...], $currentPath, ['label' => 'Legal documents']);Placeholder and prose
Every unsourced claim is marked in place and listed in the Page spec drawer.
About the founder
[placeholder] Founder story to be supplied.
PHP
ui\prose([ui\el('h2', [], '...'), ui\el('p', [], ui\placeholder('Founder story to be supplied.'))]);Filter
GET search form that works without JS; with JS it filters [data-ty-filter-item] live and updates the count.
- Roofing
- Plumbing
- Electrical
- Landscaping
PHP
ui\filter('trade-list', 'Search trades', ['action' => '/industries/', 'value' => $q, 'count' => '20 trades']);Sign-up and sign-in
Added in F3. See them in place starting at Create account and Sign in.
Password with reveal
A "Show" toggle button (aria-pressed) that JS turns on; without JS it stays hidden and the field works as usual.
PHP
ui\input('password', 'Password', ['type' => 'password', 'autocomplete' => 'new-password', 'reveal' => true]);Code input
Numeric keypad on phones, SMS autofill (one-time-code), large spaced digits.
PHP
ui\code_input('code', 'Email code', ['required' => true, 'error' => $wrong ? 'That code is not right.' : null]);Option cards
ui\radios() with cards: big tap targets; the whole card is the label. Options can carry a hint and an aside (badge).
PHP
ui\radios('org', 'Organizations you belong to', ['1' => ['Rivera Bros Roofing', 'Roofing · 1 live website', ui\badge('Owner')], ...],
['value' => '1', 'cards' => true]);Message
Chat bubble for the AI interview and inbox previews.
Tradey AI
Which services do you offer?
Dana Martinez, website form
Can someone look at the roof this week?
PHP
ui\message('Tradey AI', 'Which services do you offer?', ['from' => 'ai']);
ui\message('Dana Martinez, website form', '...');Editor and publish
Added in F4 (src/UI/functions/editor.php). See them in place in the builder and on publish approval.
Toolbar and device switch
ui\toolbar() groups controls with dividers; the "end" group goes right. ui\device_switch() is a set of links with aria-current, so the choice survives reloads and works without JS.
PHP
ui\toolbar([[ui\button('Undo', [...])], [ui\device_switch($devices, $device, fn ($k) => $url($k), ['compact' => true])],
'end' => [ui\button('Save draft', [...])]], ['label' => 'Builder tools']);Panel and outline
ui\panel() is the titled box used in editor sidebars; ui\outline() is a selectable list (pages, sections) with aria-current.
Sections
PHP
ui\panel('Sections', ui\outline(['hero' => ['label' => 'Hero', 'href' => ..., 'icon' => 'home'], ...], $current, ['numbered' => true]), ['flush' => true]);Palette
Addable blocks as tiles. Each tile is a link ("select to add"); drag-and-drop arrives with the real editor.
PHP
ui\palette(['Leads' => ['quote-form' => ['label' => 'Quote form', 'icon' => 'form', 'href' => ...]]]);Suggestion
AI proposals. The AI only suggests: Apply changes the draft, and the draft still needs approval to publish (D16).
Suggested by AI
Show your license number in the header
Customers look for it before they call.
Applied by you
Add a photo to "What we do"
Added to your draft. You review it before anything is published.
PHP
ui\suggestion('Show your license number', 'Customers look for it...', ['apply' => $applyUrl, 'dismiss' => $dismissUrl]);
ui\suggestion('...', null, ['applied' => true]);Canvas and canvas block
A device-sized frame; the preview is laid out at the device width and zoomed to fit. Each section is one tab stop (a stretched "Edit … section" link).
Licensed and insured
Roof leaks fixed fast in Contra Costa County
Free inspections, same-week repairs, written quotes.
Get a free quotePHP
ui\canvas('phone', 390, [ui\canvas_block('Hero', $preview, ['href' => $selectUrl, 'selected' => true, 'actions' => [...]])], ['label' => 'Phone, 390 px']);Change list and swatches
Publish review: what changes, and who proposed it. AI-suggested changes say so.
- HomeHero headline changedYour edit
- ServicesSection added: Project gallerySuggested by AI, accepted by you
PHP
ui\change_list([['page' => 'Home', 'what' => 'Hero headline changed', 'by' => 'you'], ['page' => 'Services', 'what' => '...', 'by' => 'ai']]);
ui\swatches(['Primary' => '#0F2742', ...]);Layouts
One API for every page: Layout::page(['title' => ..., 'path' => ..., 'area' => 'console'], fn () => [...]). Open each shell with sample content:
Public site: header with menu, review bar, footer with address block.
Sign-up and sign-in: logo bar, centred card, legal footer.
Client app: top bar (org, search, help, notifications, account) and grouped sidebar; free-month card.
Staff app: dark sidebar, staff badge, audit reminder.
Spacing, radii, breakpoints
4px grid.
4px
8px
12px
16px
24px
32px
48px
64px
96px
Radii
Breakpoints (min-width)
sm 480px · md 768px · lg 1024px (desktop menu, sidebar) · xl 1280px · container 1200px · touch target 44px.
Page spec (sitemap features for /styleguide/)
Path: /styleguide/ · Status: utility · Sitemap
Tradey design system reference: every UI component (src/UI/functions/) with its states and the PHP call that renders it (see docs/design-system.md).
Features
- list:Logo variants (lockup, wordmark, icon; light and dark; favicon sizes)
- list:Colour palette swatches with hex, token and contrast vs white and ink
- table:Contrast pairs in use with WCAG AA pass/fail
- list:Type scale (Archivo headings, Source Sans 3 body)
- list:Buttons (variants, sizes, icons, on dark, full width on phones)
- form:Form controls
- input/text:Text inputs with help, error, prefix/suffix, icon, readonly, disabled
- select:Select
- textarea:Textarea
- checkbox:Checkbox
- radio:Radio group
- toggle:Toggle switch
- upload:File upload drop zone
- button:Create account
- card:Cards and stat tiles
- table:Tables (clickable rows, sorted column, stacked on phones, empty, loading) with pagination
- list:Badges, chips, avatars, progress, description list, page header
- list:Alerts, banners, empty states, skeletons, spinner
- list:Tabs (panels and page links), stepper, breadcrumbs, pagination, dropdown menus
- modal:Publish, delete and form dialogs
- list:Marketing components (hero, example site preview, price card, callout)
- link:Layout shells
- list:Spacing, radii and breakpoint tokens
- link:Sitemap
Notes
- Added by Designer (design system v0.1, component library F1); not in the product sitemap.
- Rendered by src/Design/Styleguide.php via the template key. Styled pages so far: home, /styleguide/, /styleguide/layouts/.