Files
Basalt2/docs/references/elements/Breadcrumb.md
2025-10-30 13:13:21 +00:00

1.3 KiB

Breadcrumb

Extends: VisualElement

Properties

Property Type Default Description
path table {} Array of strings representing the breadcrumb segments
clickable true boolean Whether the segments are clickable
autoSize false boolean Whether to resize the element width automatically based on text

Functions

Method Returns Description
Breadcrumb.new table Creates a new Breadcrumb instance
Breadcrumb:init - Initializes the Breadcrumb instance
Breadcrumb:mouse_click boolean Handles mouse click events
Breadcrumb:onSelect Breadcrumb Registers a callback for the select event

Breadcrumb.new()

Returns

  • table self

Breadcrumb:init(props, basalt)

Parameters

  • props table
  • basalt table

Breadcrumb:mouse_click(button, x, y)

Parameters

  • button number
  • x number
  • y number

Returns

  • boolean handled

Breadcrumb:onSelect(callback)

Registers a callback for the select event

Parameters

  • callback function The callback function to register

Returns

  • Breadcrumb self The Breadcrumb instance

Usage

breadcrumb:onSelect(function(segmentIndex, path) print("Navigated to segment:", segmentIndex, path) end)