Layout
TwContextMenu
TwContextMenu is a Blazor right-click context menu with icons, shortcut hints, check and radio items, submenus and full keyboard support.
Last updated
Tick and radio options
A
TwMenuCheckboxItem is an option that is on or off; bind @bind-Checked. A TwMenuRadioGroup holds TwMenuRadioItem options of which one is chosen; bind its @bind-Value and give it a Label, which screen readers read as the group's name. Choosing either kind leaves the menu open, so several options can be changed in a row; set CloseOnClick to close it instead.Bookmarks shown, full URLs hidden, signed in as Pedro Duarte.
Groups
Use
TwMenuGroup to put items under a heading, which screen readers read as the group's name, and TwMenuDivider for a line between groups. The arrow keys pass over both.An area that can take focus
When nothing inside the area can take focus, such as a canvas or an image, set
Focusable to make the area a Tab stop of its own, and name it with an aria-label attribute. Screen readers are then told that Shift+F10 or the Menu key opens its menu. Set Disabled to turn the menu off and leave the browser's own menu in its place.Theme configuration
Styling is controlled by
TwBlazorTheme.Components (a TwMenuTheme), configured via the
AddTwBlazor() options callback described on the Get Started page.
Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
Inherited from TwMenu - this component reuses that theme rather than defining its own.
| Property | Type | Controls |
|---|---|---|
Root |
string | |
Panel |
string | |
Item |
string | |
ItemDisabled |
string | |
ItemIcon |
string | |
CheckIcon |
string | |
CheckIconHidden |
string | |
Divider |
string | |
GroupLabel |
string | |
ItemShortcut |
string | |
ItemDestructive |
string | |
ItemInset |
string | |
SubmenuTrigger |
string | |
SubmenuIcon |
string | |
ContextArea |
string |
Full reference: TwMenuTheme on the API docs.