Canopy Focus — Best Practices
This skill provides usage guidance for the Canopy lgFocus directive from @legal-and-general/canopy.
Apply this skill when you need to programmatically set focus on a focusable element.
Import
import { LgFocusDirective } from '@legal-and-general/canopy';
Basic Usage
<button [lgFocus]="shouldFocus">Click me</button>
Bind lgFocus to a boolean expression. When the value becomes true, the element receives focus.
Inputs
| Input | Type | Default | Required | Description |
|-------|------|---------|----------|-------------|
| lgFocus | boolean | null | Yes | When true, focus is applied to the element. |