> For the complete documentation index, see [llms.txt](https://fluentv2.hungquan99.site/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fluentv2.hungquan99.site/getting-started/create-a-window.md).

# Create a window

```lua
local Window = Fluent:CreateWindow({
    Title = "My Script",
    SubTitle = "by You",
    Size = UDim2.fromOffset(580, 460),
    Icon = "settings",
    Acrylic = true,
    Theme = "Dark",
    MinimizeKey = Enum.KeyCode.LeftControl,
    TabWidth = 160,
    Search = true,
    DropdownsOutsideWindow = false,
})
```

Call `CreateWindow` once. A later call returns `nil`.

### Key options

`Title` identifies the interface. `SubTitle` adds secondary context beneath it.

* `Size` defines the initial window dimensions.
* `Icon` uses a Lucide icon name, such as `"settings"`.
* `Search` enables the window search control.
* `DropdownsOutsideWindow` lets dropdown menus extend beyond the window edge.

`Acrylic` has no effect in Studio. Use it in supported clients.

### Add your first tab

Create a tab from the window. Add a section to the returned tab.

```lua
local MainTab = Window:AddTab({ Title = "Main", Icon = "home" })
local General = MainTab:AddSection("General", "settings", false)
```

Pass `true` as the third `AddSection` argument to start collapsed. Add an `Idx` as the fourth argument to persist collapsed state.

```lua
local General = MainTab:AddSection("General", "settings", false, "GeneralSection")
```

| Method                                           | Description                  |
| ------------------------------------------------ | ---------------------------- |
| `Window:AddTab({ Title = "...", Icon = "..." })` | Creates and returns a tab.   |
| `Window:SelectTab(TabObject)`                    | Switches to a tab.           |
| `Window:Minimize()`                              | Toggles the minimized state. |
| `Window:ToggleSearch()`                          | Toggles the search bar.      |
| `Window:Destroy()`                               | Removes the interface.       |

Use `Window:SelectTab(MainTab)` to switch tabs from code. Use `Window:Dialog(...)` for a confirmation prompt.

Continue with [tabs, SubTabs, and sections](/build-the-interface/tabs-subtabs-and-sections.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://fluentv2.hungquan99.site/getting-started/create-a-window.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
