pencere

Components / Fields and choices

u:tabs

Tabs in a strip that scrolls across: items are { key, title, hint, icon, dirty, closable, tone, tip }, active the key of the one in front.

Tabs in a strip that scrolls across: items are { key, title, hint, icon, dirty, closable, tone, tip }, active the key of the one in front. Tabs in a strip that scrolls across: items are { key, title, hint, icon, dirty, closable, tone, tip }, active the key of the one in front.

The code

return u:tabs("tabs", {
	items = {
		{ key = "main.lua", title = "main.lua" },
		{ key = "notes.md", title = "notes.md", dirty = true },
		{ key = "todo.txt", title = "todo.txt" },
	},
	active = "main.lua",
	reorder = true,
})

What it does

Tabs in a strip that scrolls across: items are { key, title, hint, icon, dirty, closable, tone, tip }, active the key of the one in front. The pointer chooses one as it goes down on it (select), closes one with its cross or the middle button (close), asks for its menu with the right button (context { key, at }); with reorder, a tab dragged onto another is put in front of it (move { key, before }: before is the key of the tab it goes in front of, nil for the end). A tab with unsaved changes (dirty) shows a dot where its cross is until the pointer is over it. The tab in front is scrolled into view once the page has been laid out. The arrow keys, home and end on a tab move to another and choose it.

kit/sandbox/library/ui/controls.luau, line 224

Its icon

An icon that a component or one of its items takes is an element the page made, a path of the page's own bundle ("icons/save.svg": an SVG or a PNG, tinted in the colour the component draws it in), or the name of one of the library's glyphs: check, chevron_down, chevron_left, chevron_right, chevron_up, close, dash, dot, info, plus, warning.