canopy-modal

Consolidate Canopy Modal usage guidance for Angular projects.

23|46|Updated Sep 7, 2020
One-click install
npx skills add https://github.com/Legal-and-General/canopy --skill canopy-modal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canopy-modal
Source: https://github.com/Legal-and-General/canopy/tree/main/skills/best-practice/modal
Command: npx skills add https://github.com/Legal-and-General/canopy --skill canopy-modal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Best practices for using the Canopy Modal component across Angular projects, ensuring consistent behavior, accessibility, and UX.

Core Features & Use Cases

  • Declarative trigger via lgModalTrigger on a button to open a modal
  • Programmatic control with LgModalService for open/close flows
  • Accessibility and UX guidelines including keyboard dismissal and focus management

Quick Start

Install canopy modal guidance, import the modal components in your Angular module, and use lgModalTrigger to open a modal.

Frequently Asked Questions about canopy-modal

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to manage modal focus and keyboard dismissal in Angular?

To open a Canopy Modal in Angular, import the modal components into your module and use the lgModalTrigger directive on a button for declarative trigger, or use LgModalService for programmatic open and close flows.

Can I use LgModalService for programmatic modal control?

Yes, LgModalService allows programmatic control of modals in Angular projects, allowing you to manage open and close flows dynamically instead of relying on declarative lgModalTrigger buttons.

How do I open a Canopy Modal declaratively in an Angular app?

To open a Canopy Modal declaratively in an Angular app, import the modal components into your module and apply the lgModalTrigger directive to a button to trigger the modal opening automatically.

When should I use a declarative trigger versus a service for Angular modals?

Use a declarative lgModalTrigger on a button for simple modal openings, and use LgModalService for complex programmatic open and close flows requiring dynamic control within your Angular application.

Why is focus management important for Angular modal components?

Focus management is important for Angular modal components because it ensures accessibility and consistent UX, allowing keyboard users to dismiss modals properly and navigate content without losing context.