canopy-forms-date
Best practices for the Canopy Date Input component.
Skill by Legal-and-General
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/legal-and-general-canopy-forms-date
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/canopy-forms-date
What's inside
- Skill name
canopy-forms-date- Description
- Best practices for the Canopy Date Input component. Trigger when capturing or validating date values in a form in an Angular project using Canopy.
- License
- MIT
- Metadata
- source: https://github.com/Legal-and-General/canopy/tree/master/projects/canopy/src/lib/forms/date/docs/guide.mdx
- Instructions
- 105 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: "canopy-forms-date" does not match folder "forms-date"
Files (1)
- SKILL.md
SKILL.md (first lines)
# Canopy Date Input — Best Practices
This skill provides usage guidance and input reference for the Canopy `lg-date-field` component from `@legal-and-general/canopy`.
Apply this skill whenever you use `LgDateFieldComponent`.
---
## Import
```ts
import { LgDateFieldComponent } from '@legal-and-general/canopy';
```
---
## Basic Usage
Use Angular reactive forms. Always include a `#validationForm="ngForm"` reference and a submit button inside the same `<form>`.
```html
<form [formGroup]="form" (ngSubmit)="onSubmit()" #validationForm="ngForm">
<lg-date-field formControlName="dateOfBirth">
Date of birth
@if (isControlInvalid(dateOfBirth, validationForm)) {
<lg-validation>
@if (dateOfBirth.hasError('invalidField')) {
Enter a valid {{ dateOfBirth.errors.invalidField }}
}
@if (dateOfBirth.hasError('requiredField')) {
Date of birth must include a {{ dateOfBirth.errors.requiredField }}
}
@if (dateOfBirth.hasError('invalidDate')) {
Enter a valid date of birth
}
@if (dateOfBirth.hasError('required')) {
Enter a date of birth
}
</lg-validation>
}
</lg-date-field>
<button type="submit">Submit</button>
</form>
```
---
## Using in a Child Component
When `lg-date-field` is in a child component with its own form group, inject `ControlContainer` and use `formGroupName`:
```ts
@Component({
viewProviders: [
{ provide: ControlContainer, useExisting: FormGroupDirective },
],
})
export class ChildComponent {}
```
```html
<ng-container formGroupName="childGroup">
<lg-date-field formControlName="date">Date of birth</lg-date-field>
</ng-container>
```
---
## Inputs
| Input | Type | Default | Description |
|-------|------|---------|-------------|
| `dateId` | `string` | auto-generated | `id` for the day input. |
| `monthId` | `string` | auto-generated | `id` for the month input. |
| `yearId` | `string` | auto-generated | `id` for the year input. |
| `ariaDescribedBy` | `string` | `null` | ID of an element that describes the field. Always uses the hint component. |
| `focus` | `boolean` | `null` | Sets focus on the fieldset. |
---
## Validation Error Priority
The component surfaces only the most significant error at a time:
| Priority | Error key | Example message |
|----------|-----------|-----------------|
| 1 | `invalidField` | Enter a valid month |
| 1 | `invalidFields` | Enter a valid month and year |
| 2 | `requiredField` | Date of birth must include a day |
| 2 | `requiredFields` | Date of birth must include a day and month |
| 3 | `invalidDate` | Enter a valid date of birth |
| 4 | `futureDate` | Date must be in the past |
| 5 | `required` | Enter a date of birth |
Once the user fixes the first error, the next will surface automatically.
---
## Design Constraints
- The output value is a valid ISO 8601 date string: `YYYY-MM-DD`.
- The component automatically adds an `lg-hint` — do not add a second one.
- A `#validationForm="ngForm"` reference and a submit button must be present in the same `<form>` for validation to work correctly.From Legal-and-General/canopy, MIT.
More from Legal-and-General/canopy
- 0.647score
review-pr-feedback
Legal-and-General
Fetches unresolved review comments from a GitHub PR using the GH CLI, groups and summarises them, automatically reads the referenced files locally to…
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-forms-radio
Legal-and-General
Best practices for the Canopy Radio component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-accordion
Legal-and-General
Best practices for the Canopy Accordion component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-icon
Legal-and-General
Best practices for the Canopy UI Icon component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-page
Legal-and-General
Best practices for the Canopy Page component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-accessibility
Legal-and-General
Accessibility guidance for Canopy applications.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-footer
Legal-and-General
Best practices for the Canopy Footer component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-alert
Legal-and-General
Best practices for the Canopy Inline Message (Alert) component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-banner
Legal-and-General
Best practices for the Canopy Banner Message component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-notice
Legal-and-General
Best practices for the Canopy Notice component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-breadcrumb
Legal-and-General
Best practices for the Canopy Breadcrumb component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-button
Legal-and-General
Best practices for the Canopy Button component.
SkillAFreshness: A★ 24Claude Code +9
Signals
- Stars
- 24
- Forks
- 46
- Open issues
- 11
- Last commit (this folder)
- Apr 27, 2026 (6 months ago)
- Last release
- Oct 20, 2026 (8 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Legal-and-General/canopy
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Legal-and-General
- 0.647score
review-pr-feedback
Legal-and-General
Fetches unresolved review comments from a GitHub PR using the GH CLI, groups and summarises them, automatically reads the referenced files locally to…
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-forms-radio
Legal-and-General
Best practices for the Canopy Radio component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-icon
Legal-and-General
Best practices for the Canopy UI Icon component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-notice
Legal-and-General
Best practices for the Canopy Notice component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-page
Legal-and-General
Best practices for the Canopy Page component.
SkillAFreshness: A★ 24Claude Code +9 - 0.643score
canopy-footer
Legal-and-General
Best practices for the Canopy Footer component.
SkillAFreshness: A★ 24Claude Code +9
Cite this page
canopy-forms-date skill. Agent Mart. https://agentmart.dev/skills/legal-and-general-canopy-forms-date (last updated 2026-10-24)