Global AI · Design System
Components

Forms & filters

Calm, roomy controls: white inputs with soft corners, a visible label on every field and an orange focus ring. Ask only for what you need, and say why.

Field

Every control sits in a .field: a <label> tied to the input with for/id, the .input, and an optional .hint linked with aria-describedby. Stack fields with .fstack; put two short fields side by side with .frow (it stacks below 700px).

Shown to members who want to reach your chapter.
Disabled: a locked value shows grey on cream.
Do
  • A visible label on every field; mark required fields with * and required.
  • Set type, autocomplete and inputmode so phones show the right keyboard and browsers can fill it.
  • Use hints to explain why you ask.
  • Use disabled for values that can't be changed here; .input:disabled greys them out.
Don't
  • Placeholder text as the only label.
  • Ask for data you don't need; every field with personal data needs a purpose (see data-compliance).
CSS: css/framework/app.css (.field, .input, .hint, .frow, .fstack)Razor: Views/My/Onboarding.cshtmlAlso: .field-hint (same look, used in admin forms)

Errors

The site reports validation as a summary above the form: .reg-errors with role="alert" and one list item per problem, plus a toast for same-request errors. There is no per-field error style. Write each message as what went wrong and how to fix it.

Do
  • Keep the values people typed when you return the form.
  • Use asp-validation-summary="All" class="reg-errors" or loop Model.Errors into the list.
Don't
  • Errors that only say "Invalid".
  • Colour as the only signal of an error.
CSS: css/framework/registration.css (.reg-errors)Razor: Views/Auth/EnterCode.cshtml, Views/Admin/BlogEdit.cshtml

Select

A native <select class="input"> inside .select-wrap, which draws the chevron. Use it for five or more options or for long lists such as country and timezone; use radios or a segmented control for two to four.

Do
  • Start with an empty "Select a ..." or "All ..." option when nothing is chosen yet.
Don't
  • A select without .select-wrap: select.input removes the native arrow.
  • Custom JavaScript dropdowns for plain choices.
CSS: css/framework/forms.css (.select-wrap)Razor: Views/Admin/ChapterEdit.cshtml

Textarea

textarea.input for plain multi-line text. It resizes vertically and starts at 120px. Say the limit in the hint and set maxlength to match.

Optional, up to 1,000 characters.

CSS: css/framework/app.css (textarea.input)Razor: Views/People/Edit.cshtml

Checkbox & radio

.choice hides the native input and draws an orange box after it, so keep the <input> directly before .box. Add .round for radios and .choice-block with .choice-text when each option needs a title and a description. Group related options in fieldset.field with a legend, or a role="radiogroup" with a label.

Categories
ClassUse for
.choice + .boxCheckbox. Put &#10003; in the box.
.box.roundRadio. Leave the box empty.
.choice-block + .choice-textOptions with a description, such as settings and opt-ins.
.choice-disabledLocked option; also set disabled on the input.
.choice-rowShort options in one wrapping row.
Do
  • Wrap the whole option in the <label> so the text is clickable.
  • Leave marketing and newsletter opt-ins unchecked by default.
Don't
  • Remove the input or move it after .box; the checked and focus styles depend on it.
  • A checkbox for an instant on/off setting; use a toggle.
CSS: css/framework/forms.css, app.css (.choice-block)Razor: Views/My/EventEditCfp.cshtml, Views/Admin/BlogEdit.cshtml

Terms acceptance

.terms-accept shows authored terms in a scrollable, keyboard-focusable .terms-accept-body, followed by a .checkbox the person must tick before the action. Use it when an action needs agreement to specific terms, such as creating an event on a calendar with its own rules.

Calendar terms

Events on AgentCon follow these terms. Read them before you create your event.

Running your event

  • Keep the event free for attendees.
  • Follow the Global AI Community code of conduct.

Share photos and a short report within two weeks of the event.

Do
  • Render authored Markdown through the sanitizer and keep a copy of the accepted version.
  • Require the checkbox and check it again on the server.
Don't
  • Pre-tick the checkbox or hide the terms behind a link only.
  • Use it for marketing consent; use the consent checkbox.
CSS: css/framework/forms.css (.terms-accept)Razor: Views/My/_CalendarTermsAcceptance.cshtml

Toggle

A switch for a setting that is simply on or off. The label says what "on" means. It is a real checkbox underneath, so it submits with the form and works with the keyboard.

Do
  • Write the label as the "on" state.
  • Keep the <input> directly before .switch.
Don't
  • A toggle for consent or for a choice between two named options (use a segmented control).
CSS: css/framework/forms.css (.toggle)Razor: Views/Admin/BadgeTypeEdit.cshtml

Segmented control

Two to four mutually exclusive options shown at once, built from radios so it works without JavaScript. Use it for compact settings such as profile visibility.

Who can see it?

Members only means signed-in members. Private hides your whole profile.

Do
  • Label the group with role="radiogroup" and aria-labelledby.
  • Short labels, one or two words.
Don't
  • Use it as tabs or navigation; it is a form value.
  • More than four options; use a select.
CSS: css/framework/myarea.css (.seg; the .field-label style is scoped to .profile-sharing)Razor: Views/People/Edit.cshtml

Rating

A 1 to 5 score built from radios, so it works without JavaScript: each number is a square button and the chosen one fills with --orange-deep. Used for event evaluations and course feedback. Keep each <input> directly before its <label>.

Your rating 1 is poor, 5 is excellent.
Do
  • Say what 1 and 5 mean in a hint.
  • Mark the saved value checked on the server.
Don't
  • Use it for named options; use a segmented control or select.
  • Build a second rating style such as stars.
CSS: css/framework/myarea.css (.rating)Razor: Views/Eval/Index.cshtml, Views/Learn/_CourseFeedback.cshtml

Filter bar

The white bar in a list page's header band: a pill search input plus format chips (/events) or selects (/chapters). Filtering happens instantly on the client, so there is no submit button. Inside the bar, inputs become cream pills automatically.

Do
  • Give the search and every select an aria-label; there is no visible label.
  • Exactly one .fmt-chip.active at a time.
  • Show an empty state when nothing matches.
Don't
  • Use .fmt-chip outside a filter bar, or use .chip (a label) as a filter.
  • Put more than one search in a bar.
CSS: css/framework/forms.css (.filter-bar, .fmt-chip)Razor: Views/EventsPage.cshtml, Views/Chapters/List.cshtml

Filter menu

A disclosure pill whose panel holds filter links, used when filters change the URL (server-side filtering, as on /learn). It is a native <details>, so it opens with the keyboard and needs no script. The summary shows the current value.

CSS: css/framework/forms.css (.filter-menu)Razor: Views/Learn/Index.cshtml

Newsletter

The pill input and button combo for Global AI Weekly, with a .sub-note proof line. Anonymous visitors subscribe through the form below, which opens in a modal from the Subscribe button; signed-in members get a one-click confirm instead.

156 issues and counting · no spam, unsubscribe anytime

Subscribe form

Do
  • Require the consent checkbox and protect the form with Turnstile.
  • Use .newsletter-row inside .weekly-subscribe-form when input and button share a row; it stacks on phones.
Don't
  • Send an address to the mailing provider straight from the browser; it goes through our backend.
CSS: css/framework/forms.css (.newsletter, .weekly-subscribe-form, .sub-note)Razor: Views/Home/Index.cshtml, Views/Weekly/_SubscribeBox.cshtml

Autocomplete

A search input that lists matches in a .suggest panel below it, used for venue and city lookup (OpenStreetMap via Photon). It follows the ARIA combobox pattern: arrow keys move the highlight, Enter picks, and a live status line announces the result count. Click a result to pick it.

Location search and map: © OpenStreetMap contributors

Do
  • Wait for three characters before searching, and cancel the previous request.
  • Show the OpenStreetMap attribution whenever results or a map are visible.
Don't
  • Use it for a fixed list; use a select.
  • Call a third-party geocoder from the browser; requests go through /my/location-search.
CSS: css/framework/forms.css (.suggest, .location-search-*)Razor: Views/My/_LocationSearch.cshtml, _LocationSearchNote.cshtmlJS: wwwroot/js/my/edit-event-where.js

Code input

Six single-digit boxes for the passwordless sign-in code. The script moves focus forward as you type, back on Backspace, fills every box on paste and keeps a hidden code field in sync for the POST. Try typing or pasting a code.

Do
  • Put autocomplete="one-time-code" on the first box so phones can fill the code.
  • Label each box ("Digit 1" to "Digit 6").
Don't
  • Use the boxes for anything but one-time codes.
CSS: css/framework/auth.css (.otp-row, .otp-input)Razor: Views/Auth/EnterCode.cshtmlJS: js/auth.js

Rich text editor

A constrained editor for organizer-written descriptions: paragraphs, h3, bold, italic, bulleted lists and links, nothing else. Pasted content is cleaned and the HTML is sanitised again on the server. It works here; select some text and use the toolbar.

AgentCon London is a free, full day of talks and labs about building AI agents, hosted by Global AI London at LSBU.

What you'll do

  • Build an agent in a hands-on lab
  • Meet the people building with AI in London
Do
  • Render it with the _RichTextEditor partial and its _RichTextLinkModal.
  • Sanitise on the server (SafeHtml.EventDescription) whatever the client sends.
Don't
  • Add toolbar commands without updating the sanitiser.
  • Use it for short fields; use a textarea.
CSS: css/framework/forms.css (.rich-text-*)Razor: Views/Shared/_RichTextEditor.cshtml, _RichTextLinkModal.cshtmlJS: js/framework/markdown-editor.js, js/modal.js

Country & timezone

Two shared dropdowns that must behave the same everywhere. Both are a normal .select-wrap select; the rules are about where the options come from and how the value is chosen.

DropdownRules
CountryAlways a select, never free text, filled by the shared partial Views/My/_CountryOptions.cshtml with new CountrySelection(savedValue), so the saved value is selected on the server. One list of common English names (Services/Countries.cs: "United States", "South Korea"); convert names from ISO 3166, OpenStreetMap or older records with Countries.Normalize or Countries.FromIsoCode.
TimezoneOptions from TimezoneHelper.GetIanaTimezones(current); the stored value is the IANA id, marked selected on the server (edit forms need no script). Only where nothing is saved yet, such as onboarding, a script preselects the browser timezone when the select is empty.
Do
  • Pass the saved value to GetIanaTimezones so it stays selectable.
  • Show the DST-aware offset labels the helper produces.
Don't
  • Build a timezone list from TimeZoneInfo.GetSystemTimeZones().
  • Store Windows ids or numeric offsets.
  • Build a second country list, or preselect a country with a data-selected script; a test fails on both.
Razor: Views/My/_CountryOptions.cshtml, Views/My/ChapterSettings.cshtml, Views/My/Onboarding.cshtmlSkills: .github/skills/frontend-conventions/SKILL.md, .github/skills/timezones/SKILL.md

Photo upload & crop

Profile photos use the .file-dropzone: a dashed drop area that also opens the file picker when clicked. Choosing or dropping a photo opens a crop step in a modal, where the member drags the photo inside a round guide and zooms by pinching, with the slider, the mouse wheel or +/- (arrow keys move it). HEIC photos are accepted where the browser can open them (Safari); elsewhere members are asked for a JPEG or PNG. Only the cropped 800px square is uploaded, as a JPEG, in place: the page does not reload, so unsaved changes in the rest of the form are kept.

PartUse
.file-dropzone + __zoneThe drop area: a <label for> around the current photo, an upload icon and a __hint. .is-dragover on the form highlights it while a file is dragged over, and .is-uploading dims it while the photo uploads.
.file-dropzone--compactFor profile photos: tighter padding, and the icon and hint sit on one line in a .file-dropzone__cta under the photo.
.file-dropzone__logo + [data-file-dropzone]For logos submitted with a larger form (partner profiles): the current logo keeps its shape inside a compact zone. Add data-file-dropzone to the wrapper, data-file-dropzone-input to the input and data-file-dropzone-preview to the image; js/framework/file-dropzone.js accepts a dropped file and previews it, and the file uploads when the form is saved.
.file-dropzone__inputThe file input, hidden visually but still reachable with Tab; its focus ring shows on the zone. Don't hide it with .d-none, which removes it from the keyboard.
Views/My/_PhotoCropModal.cshtmlThe crop modal (.photo-crop-frame, a <canvas> and the .photo-crop-zoom slider). Render it once next to a [data-direct-photo-upload] block; my-profile.js opens it with gaicModal and uploads with X-Requested-With: fetch, so the endpoint answers { url } or { error }.
Do
  • Confirm the result with a toast (window.gaicToast: "Profile photo saved." or the error), and mark the zone .is-uploading while it uploads.
  • Keep the redirect fallback on the endpoint for requests without the fetch header.
Don't
  • Auto-submit a separate photo form; it reloads the page and loses unsaved details.
  • Use the crop step for logos or banners; it is for round profile photos.
CSS: css/framework/report.css (.file-dropzone), css/framework/myarea.css (.photo-crop-*)Razor: Views/My/Profile.cshtml, Views/My/ChapterLeadOnboarding.cshtml, Views/My/_PhotoCropModal.cshtmlJS: wwwroot/js/my-profile.js, wwwroot/js/framework/file-dropzone.js (logos)