Refactor components section in 3-components.md

Updated the components section to improve formatting and clarity.
This commit is contained in:
sindri 2026-03-02 13:43:55 +01:00 committed by GitHub
parent c247a2eeb2
commit 0e9fc76e5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
<img width="239" height="496" alt="image" src="https://github.com/user-attachments/assets/2d5de615-60bc-4e1b-997f-ec1cac69c8df" /># Components
# Components
Vide encourages separating different parts of your UI into functions called
*components*.
@ -32,9 +32,6 @@ local function Button(props: {
end
return Button
```
```luau [Menu.luau]
local create = vide.create
local source = vide.source
local effect = vide.effect
@ -115,8 +112,6 @@ local function Menu()
end
return Menu
```
```luau [slider.luau]
-- Example of a component that wraps the built-in slider component.
-- This keeps a consistent "component(props) -> Instance" style.
@ -165,5 +160,3 @@ end
return Slider
:::
A single parameter `props` is used to pass properties to the component.