Skip to content

Developing Components

yyna edited this page Mar 5, 2026 · 3 revisions

last updated for yast-core 0.2.0

Components are the building blocks of YASX Layouts.
Many components come by default.

Setup

You will need a Lua LSP, and the yast.lua file, located in specs/.
yast.lua contains all of the bindings for the YASX ecosystem.

Component Structure

YASX looks at all .lua files in the components/ directory, located in your data folder.
Each component MUST return a single table, that must look like this:

return {
  -- the name of the component
  name = "My Component",
  -- the author; hello, this is you!
  author = "Me",
  -- the settings factory for your component
  settings = 
    function()
      return settings_factory()
    end,
  -- what gets rendered on the screen
  widget =
    function()
      return widgets.space():into()
    end
}

Components get their settings factory called when YASX opens, and only then.
YASX does not have hot-reloading of components, so you need to restart YAST/YASLE every time.

For more details, or examples, look at the spec, or look at the default components.

Clone this wiki locally