Skip to main content
cngx-src documentation

CngxContextMenuItemRadio

ComponentOnPushNo encapsulationv0.1.0WCAG AA

projects/ui/context-menu/context-menu-item-radio.component.ts

Import#

import { CngxContextMenuItemRadio } from '@cngx/ui/context-menu'

Description#

A radio-style context-menu item (role="menuitemradio"). Thin shell over CngxMenuItemRadio: the brain owns the role, the active-descendant registration and the reactive aria-checked. Mutual exclusion is scoped to the enclosing [cngxMenuGroup] - the group owns the selected value, the item forwards its value.

<div cngxMenuGroup label="Density" [(selectedValue)]="density">
  <cngx-context-menu-item-radio value="cozy">Cozy</cngx-context-menu-item-radio>
  <cngx-context-menu-item-radio value="compact">Compact</cngx-context-menu-item-radio>
</div>

https://cngxjs.github.io/cngx/examples/#/ui/context-menu/selection/checkbox-radio-items

Metadata#

Host#

Relationships

Index#

Inputs#

input()

Leading glyph shorthand rendered in the icon slot (decorative, aria-hidden). Suppressed when the consumer projects a richer [cngxMenuItemIcon] marker. The checked-indicator gutter renders independently of the icon, so a checked item stays visibly checked beside a custom icon.

input()

Keyboard-shortcut hint rendered in the kbd slot (decorative).

Instance Properties#

projectedIcon#unknown
contentChild()ProtectedReadonly

A consumer-projected [cngxMenuItemIcon] marker, when present. Gates the string [icon] shorthand off so the projected icon is the only one drawn.

contentChild(CngxMenuItemIcon)

HostBindings#

BindingExpression
[style.--cngx-context-menu-item-check-glyph]checkGlyph

Default visuals for CngxContextMenuItem and the checkbox / radio shells that share this stylesheet. The item brains are host directives, so the base [cngxMenuItem] attribute rules in cngx-menu.css never reach these hosts - the row geometry (padding, gap, radius, cursor, tap-target floor) is painted here, while the slot layout (.cngx-menu-item__label, __icon, __kbd) and the highlighted / disabled state painting is adopted from the base skin via the classes the brains stamp. The checked-indicator glyph is likewise attribute-keyed in the base skin, so the organism re-draws it keyed on the role the brain sets.

Inheritance

  • --cngx-context-menu-item-caret-color -> --cngx-color-text-muted
  • --cngx-context-menu-item-check-color -> --cngx-color-primary

Pair with

  • @cngx/themes/material/context-menu-theme - Material 3 palette

Index#

Layout

--cngx-context-menu-item-padding#*
Default value 6px 10px

Padding shorthand on each item row. Derived from the --cngx-space-* scale at the host so density tracks (the registered pixel initial defeats the use-site fallback).

--cngx-context-menu-item-gap#<length>
Default value 8px

Inline gap between an item's slots (icon / label / kbd / caret). Derived from --cngx-space-sm.

--cngx-context-menu-item-radius#<length>
Default value 4px

Corner radius of each item row.

Surface

--cngx-context-menu-item-caret-color#<color>
Default value oklch(0.5 0.01 250)

Color of the trailing submenu caret. Falls back through --cngx-color-text-muted.

See: [[--cngx-color-text-muted]]

State / Checked

--cngx-context-menu-item-check-color#<color>
Default value oklch(0.66 0.19 50)

Color of the leading checkbox / radio indicator glyph on a checked item. Falls back through --cngx-color-primary.

See: [[--cngx-color-primary]]