> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sirius.menu/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting started

> Load Rayfield Gen2 and build your first window in a few lines.

## Load the library

Add one line at the top of your script to pull in Rayfield Gen2.

```lua theme={null}
local Rayfield = loadstring(game:HttpGet("https://sirius.menu/gen2"))()
```

## Build a window

A window is the entry point. Create one, add a tab, and fill it with elements.

```lua theme={null}
local window = Rayfield:CreateWindow({
    name = "Example Hub",
    subtitle = "Rayfield Gen2",
})

local tab = window:CreateTab({ name = "Home", icon = 93364949241311 })

tab:CreateButton({
    name = "Say hello",
    callback = function()
        window:Notify({ title = "Hello", content = "Your first element works." })
    end,
})

tab:CreateToggle({
    name = "Auto Sprint",
    callback = function(value)
        print("Auto Sprint:", value)
    end,
})
```

The first visible tab opens on its own, so there is nothing else to wire up.

## Turn on saving

Pass a `configuration` table and the window remembers every value between sessions. Nothing else is required, and each value restores as its original type.

```lua theme={null}
local window = Rayfield:CreateWindow({
    name = "Example Hub",
    configuration = {
        autoSave = true,
        autoLoad = true,
        fileName = "ExampleHub",
    },
})
```

<Card title="How saving works" icon="save" href="/rayfield-gen2/saving">
  Flags, multiple configurations, and reading values back out.
</Card>

## Next steps

<CardGroup cols={2}>
  <Card title="Windows" icon="app-window" href="/rayfield-gen2/windows">
    Titles, tags, themes, and every window method.
  </Card>

  <Card title="Tabs and groups" icon="layout-grid" href="/rayfield-gen2/tabs">
    Organise a tab into sections, columns, and grids.
  </Card>

  <Card title="Elements" icon="square-mouse-pointer" href="/rayfield-gen2/elements/overview">
    Every control you can drop into a tab.
  </Card>

  <Card title="Secure mode" icon="shield-check" href="/rayfield-gen2/secure-mode">
    Ship a build with nothing to fingerprint.
  </Card>
</CardGroup>
