Skip to content

Drilldown Menu

<tpg-drilldown-menu></tpg-drilldown-menu>

DrilldownMenus are one of the dropdown Menu types used by Combo Boxes. In Grammar Web, this is implemented as a separate combo box component. They convert a series of nested lists into a vertical drilldown menu. They should always have a dedicated Section Header.

They forward navigate from right to left and can be navigated backwards by the “Back” button on their header. The button will always display the name of the parent category.

Examples

Basic

You can use the placeholder attribute to set a placeholder text. You can also use type and message properties for setting badge and textfield variant.

Default value

Use the selectedValue property to set a default selected value.

Full width

Use the fullWidth property to make the menu items scale to the width of the textfield (will exceed width if menu item is larger than the textfield).

Confirm button

Use the enableFooter property to render a button in the dropdown footer that emits the value of the current level/group you are in.

Event handling

The DrilldownMenu emits a TpgChangeEvent <string>when a menu item without children is clicked. If the enableFooter property is set to true, it will also emit the event when the Confirm button is pressed.

Use the enableFooter property to render a button in the dropdown footer that emits the value of the current level/group you are in.

Tables

Properties

Attribute Property Description Type Default Value
placeholder placeholder Optional placeholder that is visible if value is empty string ''
selected-value selectedValue Optional property to preselect a Drilldown Menu Item. Needs to correspond with a Menu Item's value. string ''
leading-icon-template leadingIconTemplate URI-encoded SVG template for the button's icon. Supported constants are found in IconConstant | '' ''
is-open isOpen Simple flag to keep track of whether or not the drilldown-menu is open/closed. boolean false
full-width fullWidth Flag that makes the drilldown menu scale to the width of the textfield if true. boolean false
enable-footer enableFooter Flag that enables the "Confirm" button at the bottom of the menu. boolean false
message message Message to appear on badge if set. string ''
type type The type of textfield to render in terms of severity-level. 'default' | 'error' | 'warning' | 'danger' 'default'

Events

Event name Reactjs attribute Description
tpg-change ontpg-change Event emitted when item in drilldown menu is confirmed.

Functions

Name Description Arguments
openMenu Opens the menu No parameters
closeMenu Closes the menu No parameters

Slots

Name Description
default slot for drilldown menu

CSS Parts

Attribute Description
No CSS parts found.

Sandbox