> ## 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.

Sentivel
Endorsed by Rayfield

Status pages and uptime monitoring for whatever you ship. Free to start.

Take a look


[Open](https://www.sentivel.com/?ref=sirius-docs\&utm_source=sirius-docs\&utm_medium=referral\&utm_content=banner)

## Load the library

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

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

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

Stable is the release, and what your scripts should load. Preview is a rolling build from `dev` for trying what is coming next. See [Preview](https://docs.sirius.menu/rayfield-gen2/preview.md).

## 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",
    sidebarLayout = true,
})

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] [How saving works](https://docs.sirius.menu/rayfield-gen2/saving.md)
>
> Flags, multiple configurations, and reading values back out.

## Share it

Publish your script on [RoScripts](https://roscripts.io/?ref=sirius-docs) and people can find it by game, copy a loadstring link that keeps working through every update, and see what Scriptsight found when it read the code.

> [card] [Publish on RoScripts](https://docs.sirius.menu/roscripts/publish.md)
>
> List your script for free, with a short link and a Scriptsight review.

## Next steps

> [card] [Windows](https://docs.sirius.menu/rayfield-gen2/windows.md)
>
> Titles, tags, themes, and every window method.

> [card] [Tabs and groups](https://docs.sirius.menu/rayfield-gen2/tabs.md)
>
> Organise a tab into sections, columns, and grids.

> [card] [Elements](https://docs.sirius.menu/rayfield-gen2/elements/overview.md)
>
> Every control you can drop into a tab.

> [card] [Secure mode](https://docs.sirius.menu/rayfield-gen2/secure-mode.md)
>
> Ship a build with nothing to fingerprint.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.