Writing assistant
A draft closer to your voice.
Clear verbs, one primary action per decision.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| variant | default / secondary / brand | One primary action per decision. |
| size | default ≥44px / small 36px | Small is for dense secondary actions; keep primary touch targets ≥44px. |
| state | default / hover / focus / pressed / loading / disabled | Use native disabled; loading follows actual work. |
<button class="nq-button">Start a conversation</button>
<button class="nq-button secondary">Save</button>
<button class="nq-button brand">Try Nasaq</button>
<button class="nq-button" disabled>Unavailable</button>Use native disabled for unavailable actions. Tie loading to actual work, keep the label meaningful, and prevent duplicate submission.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Commit or change something. Use a link to move to another page.
A row of equally dominant actions, or icon-only actions without a name.
Action label · optional directional icon · loading indicator
Tab reaches enabled actions; Enter and Space activate. Disabled actions leave the tab order.
component.button.height / component.button.radius / component.button.light.backgroundUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Persistent labels, concise help and actionable validation.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| type | text / email / search / password | Choose the input type for the data, not its appearance. |
| state | empty / filled / focus / invalid / readonly / disabled | Readonly remains selectable; disabled is unavailable. |
| message | label + help + error | Connect help/error with aria-describedby. |
<div class="nq-field">
<label for="email">Email address</label>
<input id="email" class="nq-input" type="email" dir="ltr"
aria-describedby="email-help" required>
<span id="email-help" class="nq-help">Project contact address.</span>
</div>Keep labels visible. Associate help/error messages with aria-describedby. Validate at a useful moment and preserve input after errors.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Collect one short value with a persistent visible label.
Placeholder-only labels or deleting a value after validation fails.
Label · field · help · validation message
Tab moves to the field. Native editing, selection and browser autofill remain available.
component.input.height / component.input.padding-inline / component.input.light.borderUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →One choice from a compact list of named options.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| control | native select | Use for a compact list of mutually exclusive choices. |
| value | prompt / selected | Use an empty prompt when a deliberate choice is required. |
| state | default / focus / invalid / disabled | Keep validation outside the options. |
<label for="assistant">Assistant</label>
<select id="assistant" class="nq-select">
<option>Writing assistant</option>
<option>Research assistant</option>
</select>Prefer native select for simple choices. Use a visible label and an empty prompt when no selection is required by default.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Choose one item from a named, finite list.
Large searchable catalogs or hidden actions inside options.
Label · selected option · native disclosure · help
Use the operating system’s native select keys. Tab enters/leaves; arrow and type-ahead behavior stays native.
component.input.height / component.input.radiusUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Independent choices and explicit mixed selection.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| selection | checked / unchecked / indeterminate | Indeterminate is a JavaScript property. |
| group | fieldset + legend | Group related independent options. |
| state | default / focus / disabled | Keep the label in the click target. |
<fieldset>
<legend>Research sources</legend>
<label class="nq-check"><input type="checkbox" checked> Documents</label>
<label class="nq-check"><input type="checkbox"> Team library</label>
</fieldset>Use a native checkbox. Set its indeterminate property for mixed state; give every choice a stable label.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Choose any number of independent options.
A setting that takes effect immediately; use a switch there.
Native checkbox · stable label · optional group legend
Tab focuses each checkbox; Space toggles. Expose mixed selection through the native indeterminate property.
control.height / space.8 / semantic.light.focusUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →A setting that changes immediately.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| geometry | 48 × 28px / 20px thumb | The label provides a ≥44px touch target. |
| value | checked / unchecked | The label names the setting and does not change with state. |
| state | on / off / focus / disabled | Use role=switch on a native checkbox. |
<label class="nq-check">
<input class="nq-switch" type="checkbox" role="switch" checked>
Save conversation history
</label>Use a native checkbox with role="switch" and a stable label. Test click, Space, on/off, disabled, RTL and LTR; keep the label target at least 44px.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Change a setting that takes effect immediately.
Form submission, agreement to terms, or an action that needs confirmation.
Label · track · thumb · optional help
Tab focuses the switch; Space toggles. Keep checked as the source of truth.
component.switch.width / component.switch.height / component.switch.thumbUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Related content panels within one context.
Every project idea in one place.
No documents yet. Add your first file.
Set the project name and conversation retention preferences.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| activation | automatic | Arrow keys move focus and select the associated panel. |
| relation | tablist / tab / tabpanel | Each tab controls exactly one panel. |
| direction | RTL / LTR | Arrow movement follows the reading direction. |
<div data-tabs>
<div class="nq-tabs" role="tablist" aria-label="Project">
<button id="t1" role="tab" aria-selected="true" aria-controls="p1">Overview</button>
<button id="t2" role="tab" aria-selected="false" aria-controls="p2" tabindex="-1">Documents</button>
</div>
<div id="p1" role="tabpanel" aria-labelledby="t1">Summary</div>
<div id="p2" role="tabpanel" aria-labelledby="t2" hidden>Files</div>
</div>
<script src="nasaq.js"></script>Keep role=tablist, tab and tabpanel linked with aria-controls/labelledby. Support arrows, Home and End; account for writing direction.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Switch among related views of the same context.
Sequential steps, site navigation, or too many labels to fit.
Tablist · labelled tabs · associated panels
Tab enters the active tab. Left/Right move focus and select in reading order; Home/End go to bounds.
space.16 / semantic.light.action / semantic.light.borderUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →A small written status, category or count.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| tone | neutral / success / warning / error | Include text; tone alone is insufficient. |
| interaction | non-interactive | A badge is not a button. |
| content | short status label | Allow translation expansion. |
<span class="nq-badge">Writing assistant</span>
<span class="nq-badge success">Available</span>
<span class="nq-badge error">Connection failed</span>Badges communicate status without acting like buttons. Include a written label; do not rely on color alone.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Give a short status or classification.
Primary actions, long explanations, or color as the only meaning.
Status text · optional decorative symbol
No tab stop for a static badge. Announce a dynamic status through the owning status region.
radius.pill / space.8 / color.successUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →A person or assistant with a dependable fallback.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| content | image / initials / assistant / fallback | Use a meaningful fallback when an image fails. |
| shape | circle | Keep dimensions stable while content loads. |
| presence | optional status | Pair presence with written meaning. |
<span class="nq-avatar" role="img" aria-label="Sarah Ahmed">SA</span>
<span class="nq-avatar square" role="img" aria-label="Assistant">✦</span>If the adjacent name repeats the identity, mark the avatar decorative. Provide an accessible label when the image carries meaning.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Identify a person or assistant in context.
Repeating the adjacent name in alt text or relying on initials for identity.
Image or fallback · optional presence marker
Static avatars do not receive focus. Wrap an actionable avatar in a named native link/button.
space.48 / radius.pill / color.lavenderUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →A focused decision with a clear way out.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
The previous conversation will stay in history.
This cannot be undone.
| Property | Values | Guidance |
|---|---|---|
| element | native dialog | Open with showModal; close with close. |
| focus | initial + containment + return | Choose an appropriate initial control. |
| dismiss | Escape / explicit close | Avoid nesting dialogs. |
<button data-open="new-chat">New conversation</button>
<dialog id="new-chat" class="nq-dialog" aria-labelledby="dialog-title">
<h2 id="dialog-title">New conversation?</h2>
<p>The previous conversation will stay in history.</p>
<button class="nq-button" data-close="new-chat">Start</button>
<button class="nq-button secondary" data-close="new-chat">Cancel</button>
</dialog>
<script src="nasaq.js"></script>Use native dialog.showModal(). Preserve a labelled heading, Escape dismissal, focus containment and focus return. Destructive decisions need clear consequences.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Resolve a bounded decision without losing the current context.
Long documentation, whole applications, or another dialog within a dialog.
Title · description · content · actions · close
showModal contains focus; Escape dismisses; close returns focus to the trigger. Tab stays inside.
component.dialog.padding / component.dialog.radius / semantic.light.surfaceUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Supplementary help on hover and keyboard focus.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| relation | aria-describedby | The tooltip supplements the control’s existing name. |
| trigger | hover + focus | Never make content exclusive to pointer hover. |
| dismiss | Escape | Do not place interactive controls inside. |
<span class="nq-tooltip-wrap">
<button class="nq-button secondary" aria-describedby="copy-tip">Copy response</button>
<span class="nq-tooltip" id="copy-tip" role="tooltip">Copy text to clipboard</span>
</span>
<script src="nasaq.js"></script>Keep essential instructions in visible text. Link with aria-describedby, reveal on focus and hover, and allow Escape to dismiss.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Add a brief supplementary explanation to an already named control.
Essential instructions, error messages, or interactive links.
Trigger · associated tooltip text
Focus reveals the same content as hover. Escape dismisses without moving focus.
space.8 / radius.sm / semantic.light.actionUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Exactly one choice from mutually exclusive alternatives.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| group | same name + fieldset + legend | One required choice among visible alternatives. |
| selection | checked / unchecked | Use an explicit default only when justified. |
| state | default / focus / disabled | Keep unavailable options explained. |
<fieldset class="nq-radio-group">
<legend>Assistant style</legend>
<label class="nq-check"><input type="radio" name="tone" value="direct" checked> Direct</label>
<label class="nq-check"><input type="radio" name="tone" value="detailed"> Detailed</label>
</fieldset>Use a fieldset and legend with a shared name. Native arrow keys and Space should select choices. Radios select, rather than execute an action.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Select one of a small number of visible alternatives.
Independent choices or a very long list; use checkbox or select.
Group legend · options · optional help
Tab enters/leaves the group; native arrow keys move selection. Space selects the focused option.
space.8 / control.height / semantic.light.focusUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Long instructions with room to grow.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| rows | minimum 3 recommended | Keep resizing available. |
| state | empty / filled / focus / invalid / readonly / disabled | Preserve content after errors. |
| limit | only when a real product limit exists | Explain remaining allowance before blocking. |
<label for="prompt">Assistant instructions</label>
<textarea id="prompt" class="nq-input nq-textarea" rows="4" maxlength="500" aria-describedby="prompt-help"></textarea>
<p id="prompt-help" class="nq-help">Up to 500 characters.</p>Allow vertical resizing, explain limits before input, and preserve drafts. Keep a visible label and associated help text.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Collect a paragraph or free-form instructions.
Short structured values or replacing Enter with submit without explanation.
Label · multiline field · help · error
Tab moves focus; Enter inserts a line break; standard selection and editing stay native.
component.input.radius / component.input.padding-inlineUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →A useful message that describes what happened and what to do.
Return to it from the project.
Your message was kept. Try again.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| tone | info / success / warning / error | Write what happened and what the user can do. |
| announcement | status / alert | Use alert only for urgent new information. |
| action | optional retry or recovery | Keep recovery adjacent to the message. |
<div class="nq-alert error" role="alert">
<b>Could not connect.</b><p>Your message was kept.</p>
<button class="nq-button secondary">Retry</button>
</div>Use a written status and a clear recovery action. Reserve role=alert for urgent updates; avoid announcing static page content repeatedly.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Explain a relevant outcome, problem or next step.
Persistent assertive announcements or vague messages such as “Something went wrong”.
Summary · explanation · recovery action
Static text has no tab stop. Recovery controls follow the message in DOM order.
component.alert.padding / component.alert.radius / color.errorUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Real progress with a stated value or an honest indeterminate state.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| value | 0–100 when known | Do not fabricate a percentage. |
| mode | determinate / indeterminate | Use indeterminate when duration is unknown. |
| label | visible status + native progress | State the actual unit of work. |
<label for="usage">Quota used — 28%</label>
<progress id="usage" class="nq-progress" max="100" value="28">28%</progress>Set value and max only when progress is known. Give the control a label. Omit value for indeterminate work and stop when finished or failed.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Show the completion of real, ongoing work.
Decorative percentages or progress that never resolves.
Task label · native progress · written status
The progress indicator is not focusable. Put cancellation on a separate native button.
space.8 / radius.pill / semantic.light.actionUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Temporary geometry while actual content loads.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
Content is ready.
| Property | Values | Guidance |
|---|---|---|
| meaning | decorative | Hide shapes from assistive technology. |
| region | aria-busy during loading | Announce a concise written loading status. |
| motion | optional | Respect reduced motion. |
<section aria-busy="true" aria-label="Loading">
<div class="nq-skeleton" aria-hidden="true"></div>
<span class="nq-help">Loading project…</span>
</section>Keep skeletons decorative, mark the content region aria-busy during work, and expose a textual status. Respect reduced motion and show a recoverable error.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Reserve the structure of content that is actually loading.
Indefinite loading or replacing the error/retry path.
Reserved content area · written loading status
No skeleton tab stops. Keep keyboard access to existing controls and recovery actions.
space.16 / radius.sm / semantic.light.borderUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →Optional detail without losing reading order.
This is a design example. Your product defines retention duration and settings.
Provide a clear deletion flow with appropriate confirmation.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
Additional content.
Additional content.
Additional content.
| Property | Values | Guidance |
|---|---|---|
| element | details + summary | Use native disclosure where possible. |
| state | open / closed | The summary remains visible. |
| content | supporting detail | Keep essential instructions outside. |
<div class="nq-faq">
<details><summary>How does it work?</summary><p>Clear details.</p></details>
</div>Prefer native details/summary. Keep headings and key decisions visible outside collapsed content. Do not use fabricated disabled states.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Let readers reveal supporting detail without losing the heading.
Hiding essential steps or placing controls inside the summary.
Summary · disclosure marker · expandable content
Tab focuses summary; Enter and Space toggle native disclosure.
space.16 / semantic.light.borderUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →A coherent content unit with an action in context.
A draft closer to your voice.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
A clear first draft.
An action in context.
Add your first file.
| Property | Values | Guidance |
|---|---|---|
| element | article | Use meaningful headings within a collection. |
| action | explicit link/button | Avoid nested interactive controls. |
| state | content / empty / loading / error | Keep surface geometry useful on narrow screens. |
<article class="nq-card">
<h3>Writing assistant</h3><p>A draft closer to your voice.</p>
<a class="nq-button secondary" href="/assistant/writing">Explore assistant</a>
</article>Use article for content. Make actions native links/buttons, avoiding nested interactive controls. Support empty, loading and error content.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Group a coherent piece of content with its relevant actions.
A decorative border around every paragraph or an entire clickable card with nested links.
Heading · content · metadata · actions
Only the card’s links/buttons enter the tab order, in a meaningful reading sequence.
component.card.padding / component.card.radius / component.card.light.backgroundUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →A location trail through a real hierarchy.
Hover, focus and pressed specimens are pinned for comparison. Test actual pointer and keyboard behavior in the live preview.
| Property | Values | Guidance |
|---|---|---|
| element | nav + ordered list | Give the navigation a useful name. |
| current | aria-current=page | The current item is plain text when possible. |
| overflow | wrap / simplify | Preserve the immediate parent. |
<nav class="nq-breadcrumb" aria-label="Breadcrumb">
<a href="/">Home</a><span aria-hidden="true">/</span>
<span aria-current="page">Project</span>
</nav>Use a labelled nav, links for ancestors and aria-current=page for the current location. Wrap rather than truncate essential context.
Test labels, focus, keyboard navigation, long content, disabled behavior, both themes and both reading directions. Native semantics remain the foundation.
Explain location in a multi-level hierarchy.
Replacing primary navigation or mirroring the DOM order manually.
Named nav · ancestor links · current page
Tab focuses ancestor links. The current page does not need a redundant tab stop.
space.8 / semantic.light.mutedUse the same names in design and code. Check long content and every state in both directions.
Trace design to code →