A menu is a floating panel that displays a list of actions or navigational items.
import { DaffMenuComponent } from '@daffodil/design/menu'
The floating panel that contains menu items.
@Component()
class DaffMenuComponent implements AfterContentInit, AfterViewInit {}
import { DaffMenuItemComponent } from '@daffodil/design/menu'
Individual clickable items within the menu. Applied to <button> or <a> elements.
@Component()
class DaffMenuItemComponent implements FocusableOption {
focus(): void
}
voidFocus the menu item.
import { DaffMenuActivatorDirective } from '@daffodil/design/menu'
Directive that triggers the menu to open/close. Applied to the button that activates the menu. The selector doubles as an input for the menu content to display.
@Directive()
class DaffMenuActivatorDirective implements OnDestroy {
readonly isOpen: WritableSignal<boolean> = signal(false)
@Input() daffMenuActivator: TemplateRef<unknown> | Type<unknown>
}
TemplateRef | Type | Default | – |
|---|---|
| Description | The menu content to display when activated. |
import { DaffMenuService } from '@daffodil/design/menu'
@Injectable()
class DaffMenuService {
open$: Observable<boolean> = this.$_open.asObservable()
close(): void
open(
activator: ViewContainerRef
component: DaffMenuSlot
): void
}
voidvoid| Parameter | activator: ViewContainerRef |
|---|---|
| Description |
| Parameter | component: DaffMenuSlot |
|---|---|
| Description |
import { DaffMenuModule } from '@daffodil/design/menu'
@NgModule()
class DaffMenuModule {}