CSC Design System Skills & Best Practices
CS

Proposed CSC Standards

Form standards

Labels, validation timing, and submission across forms.

Rules

FORM-001RequiredProposed CSC convention

Place the label above the field

Labels sit above the control, not only as a placeholder.

Implementation detail

Proposed CSC Standard. The label sits above the field.

Put a visible label above the field and associate it with the control.

Check: The label is visible before and during typing.

FORM-002RecommendedProposed CSC convention

Validate after blur or submit, not on first render

Errors appear after the person leaves the field or submits.

Implementation detail

Proposed CSC Standard. Errors on an untouched form look like a failure they did not cause.

Show the error text after blur or submit.

Check: A fresh form does not show field errors.

FORM-005ConditionalProposed CSC convention

Ask before leaving a dirty form

If values changed, navigating away asks the person to confirm.

Implementation detail

Proposed CSC Standard.

Use a confirm dialog. Do not add a beforeunload string that the browser will ignore.

Applies when: The form has unsaved edits and the person follows a link away.

Check: A dirty form prompts before route change.

Examples

Label and submitCorrect implementation · TSX

The label sits above the field. Submit is a #2A338F button.

Imports: None. Dependencies: None. Rules: FORM-001.

export function ReferenceForm() {
  return (
    <form>
      <label style={{ display: 'grid', gap: 7 }}>
        Reference number
        <input required style={{ border: '1px solid #DCE3ED', borderRadius: 8, minHeight: 40 }} />
      </label>
      <button type="submit" style={{ background: '#2A338F', color: '#fff', borderRadius: 8, minHeight: 38 }}>Submit application</button>
    </form>
  );
}

Testing checklist

Reusable prompts for this guideline are in the AI Development Hub.