{"id":"goatsoft/lucy","name":"lucy","scope":"goatsoft","platform":"roblox","description":"Lucy: a UI and app framework for Roblox, built on Universal Styling","version":"0.4.2","latest":"0.4.2","versions":["0.4.0","0.4.1","0.4.2"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"97843888652502041ba679159a0f853a640ac9e9ae0954d233d22f9c3b1df244","likes":1,"downloads":1,"install":"forest install goatsoft/lucy","url":"https://forest.dev/p/roblox/goatsoft/lucy","files":"https://api.forest.dev/ai/package/roblox/goatsoft/lucy/files","readme":"<p align=\"center\">\n  <a href=\"https://lucy.goatsoft.io\">\n    <img src=\"https://raw.githubusercontent.com/goatsoft/lucy/main/assets/brand/readme/lucy-head.webp\" alt=\"Lucy\" height=\"200\">\n  </a>\n</p>\n\n<h1 align=\"center\">Lucy</h1>\n\n<p align=\"center\">\n  <a href=\"https://lucy.goatsoft.io/docs/\">Getting started</a> ·\n  <a href=\"https://lucy.goatsoft.io/docs/components/\">Components</a> ·\n  <a href=\"https://lucy.goatsoft.io/docs/reactivity/\">Reactivity</a> ·\n  <a href=\"https://lucy.goatsoft.io/docs/architecture/\">Architecture</a> ·\n  <a href=\"https://lucy.goatsoft.io/docs/guide/agents/\">Agents</a> ·\n  <a href=\"https://lucy.goatsoft.io/docs/benchmarks/\">Benchmarks</a>\n</p>\n\n<p align=\"center\">A UI and app framework for Roblox, built on Universal Styling.</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/goatsoft/lucy/actions/workflows/ci.yml\"><img src=\"https://github.com/goatsoft/lucy/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"></a>\n  <a href=\"https://lucy.goatsoft.io\"><img src=\"https://img.shields.io/badge/docs-lucy.goatsoft.io-8757e2\" alt=\"Docs\"></a>\n  <a href=\"https://pesde.dev/packages/goatsoft/lucy\"><img src=\"https://img.shields.io/badge/pesde-goatsoft%2Flucy-c050ea\" alt=\"pesde\"></a>\n  <a href=\"https://forest.dev/p/roblox/goatsoft/lucy\"><img src=\"https://img.shields.io/badge/forest-goatsoft%2Flucy-22c55e\" alt=\"Forest\"></a>\n  <a href=\"https://github.com/goatsoft/lucy/blob/main/LICENSE\"><img src=\"https://img.shields.io/badge/license-MIT-5bd0f8\" alt=\"MIT Licence\"></a>\n</p>\n\n## Overview\n\nLucy is a UI and app framework for Roblox. It gives you themed components and a\nsingle place to keep your UI state.\n\nBuild UI screens from components and connect them to the app state. When a value\nchanges, Lucy updates only the properties that use it. Nothing is rebuilt, so\nyour app stays fast.\n\nMenus and HUDs work with mouse, keyboard, gamepad and touch, on phone, desktop\nand console, without handling each device yourself. Light and dark themes come\nwith it, and because the styling is Roblox's Universal Styling, hover effects\nand theme switches run no Luau.\n\n[Browse the components](https://lucy.goatsoft.io/docs/components/).\n\n## Installation\n\n### pesde\n\n```sh\npesde add goatsoft/lucy\npesde install\n```\n\n### Forest\n\n```sh\nforest install goatsoft/lucy\n```\n\nThe examples below expect Lucy at `ReplicatedStorage.Packages.Lucy` (or\n`ReplicatedStorage.roblox_packages.lucy` when installed with pesde).\n\n### Copy the source\n\nTo own and edit the components, copy them into your game with\n[Lune](https://lune-org.github.io/docs) and a copy of this repo:\n\n```sh\ngit clone https://github.com/goatsoft/lucy ~/Projects/Lucy\ncd your-game\nlune run ~/Projects/Lucy/scripts/add -- button dialog --from ~/Projects/Lucy --out src/shared/Lucy\n```\n\nThe core and anything a component needs come along (Dialog brings Button).\n`--all` copies every component.\n\n### Coding agents\n\nLucy has skills for Claude Code, Codex and Antigravity, so an agent builds your\nUI with Lucy's components. `@goatsoft/lucy-mcp` lets an agent see and press\nyour UI in Studio. See [Use Lucy with agents](https://lucy.goatsoft.io/docs/guide/agents/).\n\n## Usage\n\nMake one App on the client, then build scenes from components. This settings\nmenu has a volume slider the game reads and a theme picker that switches the\nwhole UI:\n\n```lua\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal SoundService = game:GetService(\"SoundService\")\nlocal Lucy = require(ReplicatedStorage.Packages.Lucy)\n\n-- One app per player. Its state holds your game's data and the theme.\nlocal app = Lucy.App.new({\n    theme = \"dark\",\n    state = { settings = { volume = 50 } },\n})\n\napp.scenes:register(\"Settings\", {\n    build = function(scene)\n        Lucy.Stack.new({\n            size = UDim2.fromScale(1, 1),\n            align = \"center\",\n            justify = \"center\",\n            children = {\n                Lucy.Panel.new({\n                    title = \"Settings\",\n                    maxWidth = 400,\n                    children = {\n                        -- Each control reads and writes a value in state.\n                        Lucy.Text.new({ text = \"Volume\", variant = \"label\" }),\n                        Lucy.Slider.new({ value = app.state:ref(\"settings.volume\"), showValue = true }),\n                        Lucy.Text.new({ text = \"Theme\", variant = \"label\" }),\n                        Lucy.Select.new({\n                            items = { { value = \"dark\", label = \"Dark\" }, { value = \"light\", label = \"Light\" } },\n                            value = app.state:ref(\"theme\"),\n                        }),\n                    },\n                }),\n            },\n            Parent = scene.gui,\n        })\n    end,\n})\n\napp.scenes:goTo(\"Settings\")\n\n-- The game reads the same state.\napp.state:subscribe(\"settings.volume\", function(volume)\n    SoundService.Music.Volume = volume / 100\nend)\n```\n\nEvery component keeps its state in the app, so game code can change any of it:\n\n```lua\napp.state:set(\"theme\", \"light\")          -- switch theme\napp.state:set(\"scenes.current\", \"Game\")  -- change screen\napp.toast.success(\"Round won\", { description = \"+$250\" })\n```\n\nThe [getting started guide](https://lucy.goatsoft.io/docs/) goes on from here:\n[scenes](https://lucy.goatsoft.io/docs/guide/scenes/),\n[app state](https://lucy.goatsoft.io/docs/guide/app-state/),\n[themes](https://lucy.goatsoft.io/docs/guide/themes/),\n[hotkeys](https://lucy.goatsoft.io/docs/guide/actions/) and the\n[API](https://lucy.goatsoft.io/docs/reference/api/).\n\n## Architecture\n\n```\nApp            one per player, on the client\n├─ state       all UI state in one tree of tables\n├─ theme       Universal Styling rules for every component\n├─ input       input mode, device, focus and the back button\n├─ actions     named hotkeys for keyboard and gamepad\n├─ scenes      one ScreenGui per screen, on layers\n└─ toast       toast messages\n```\n\nA component keeps its state in the app at `ui.<id>`. It builds its instances\nonce and ties each property to the values it reads, so a change sets only those\nproperties. Code sets behaviour and layout; looks come from style rules matched\nby tags. The [architecture guide](https://lucy.goatsoft.io/docs/architecture/)\nhas the rest.\n\n## Licence\n\nThe code, docs, examples, stories and agent skills are\n[MIT](https://github.com/goatsoft/lucy/blob/main/LICENSE). The Lucy name, Lucy\nthe mascot, the wordmark, the icons and the brand artwork in `assets/brand/` are\ncovered by the\n[artwork and brand licence](https://github.com/goatsoft/lucy/blob/main/LICENSE-ART.md).\nThe games and UI you build with Lucy are yours.\n\n---\n\n<p align=\"center\">\n  <a href=\"https://goatsoft.io\">\n    <picture>\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/goatsoft/lucy/main/assets/brand/goatsoft/GOATsoft-masthead-light.png\">\n      <img src=\"https://raw.githubusercontent.com/goatsoft/lucy/main/assets/brand/goatsoft/GOATsoft-masthead.png\" alt=\"GOATsoft\" height=\"48\">\n    </picture>\n  </a>\n  <br>\n  Made by <a href=\"https://goatsoft.io\">GOATsoft</a> · <a href=\"https://github.com/goatsoft/lucy/blob/main/LICENSE\">MIT Licence</a> · <a href=\"https://github.com/goatsoft/lucy/blob/main/LICENSE-ART.md\">Artwork licence</a>\n</p>\n","readmeTruncated":false}