Disableable enforces consistent use of the disabled property across components.
DaffDisableableDirective applies the daff-disabled CSS class when disabled is true.
Use daffDisableable as an attribute selector:
<div daffDisableable [disabled]="true">Content</div>
Or as an Angular host directive:
import { DaffDisableableDirective } from '@daffodil/design';
@Component({
selector: 'custom-component',
template: 'custom-component.html',
hostDirectives: [
{
directive: DaffDisableableDirective,
inputs: ['disabled'],
},
],
})
export class CustomComponent { }
Use the applied CSS class to style the disabled variant:
.custom-component {
&.daff-disabled {
cursor: not-allowed;
opacity: 0.5;
}
}