{"id":"kaan650/vide-topbar","name":"vide-topbar","scope":"kaan650","platform":"roblox","description":"Topbar icons for Vide, drawn with Foundation","version":"0.2.0","latest":"0.2.0","versions":["0.1.0","0.2.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"centau/vide":{"version":"^0.4.1","alias":"Vide"},"kaan650/vide-foundation":{"version":"^0.2.1","alias":"VideFoundation"},"littensy/vide-ripple":{"version":"^0.10.2","alias":"VideRipple"}},"integrity":"1d4358c1a5091d140912ca648ac948052c03f618b1e176053aed345d3db49f5d","likes":0,"downloads":0,"install":"forest install kaan650/vide-topbar","url":"https://forest.dev/p/roblox/kaan650/vide-topbar","files":"https://api.forest.dev/ai/package/roblox/kaan650/vide-topbar/files","readme":"# VideTopbar\n\nTopbar icons for [Vide](https://github.com/centau/vide), drawn like Roblox's own topbar with\n[VideFoundation](https://github.com/kaan650/vide-foundation).\n\n- Icons with Builder Icons glyphs or images, labels, badges and tooltips\n- Keyboard shortcuts through the Input Action System, shown as keycaps in tooltips\n- Menus that open as a list under an icon or slide out sideways, with lists inside lists\n- Text fields that slide out of an icon, for codes or search\n- Groups that share one pill, with dividers\n- Icons that don't fit move into an overflow menu, and keep clear of other UI on the topbar\n- Gamepad support, phone safe areas, room for the health bar, and the game's own translations\n\n## Install\n\n```toml\n[dependencies]\nVideTopbar = \"kaan650/vide-topbar@0.2.0\"\n```\n\n## Usage\n\n```luau\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\n\nlocal Vide = require(ReplicatedStorage.Packages.Vide)\nlocal VideTopbar = require(ReplicatedStorage.Packages.VideTopbar)\n\nVideTopbar.mount()\n\nlocal shopOpen = Vide.source(false)\nlocal coins = Vide.source(0)\n\nVide.root(function()\n\tVideTopbar.Icon({\n\t\torder = 1,\n\t\ticon = \"shopping-cart\",\n\t\tlabel = \"Shop\",\n\t\ttooltip = \"Open the shop\",\n\t\tshortcut = Enum.KeyCode.B,\n\t\tselected = shopOpen,\n\t})\n\n\tVideTopbar.Icon({\n\t\torder = 2,\n\t\ticon = \"three-bars-horizontal\",\n\t\ttooltip = \"Menu\",\n\t\tmenu = function()\n\t\t\tVideTopbar.Icon({\n\t\t\t\torder = 1,\n\t\t\t\ticon = \"gear\",\n\t\t\t\tlabel = \"Settings\",\n\t\t\t\tonActivated = function()\n\t\t\t\t\tprint(\"Settings\")\n\t\t\t\tend,\n\t\t\t})\n\t\t\tVideTopbar.Icon({ order = 2, icon = \"trophy\", label = \"Quests\", badge = 3 })\n\t\tend,\n\t})\n\n\tVideTopbar.Group({ order = 3 }, function()\n\t\tVideTopbar.Icon({ order = 1, icon = \"heart\", tooltip = \"Like\" })\n\t\tVideTopbar.Divider({ order = 2 })\n\t\tVideTopbar.Icon({ order = 3, icon = \"bell\", tooltip = \"Inbox\", badge = true })\n\tend)\n\n\tVideTopbar.Icon({\n\t\tside = \"Right\",\n\t\tlabel = function()\n\t\t\treturn `{coins()} coins`\n\t\tend,\n\t\tminWidth = 120,\n\t})\nend)\n```\n\n- An icon lives as long as the Vide scope that adds it: add it inside `Vide.root`, a component or `Vide.show`, and it\n  leaves the topbar when that scope is destroyed.\n- Props take a value or a source: `label = \"Shop\"`, `badge = notifications`, `isDisabled = function() ... end`.\n- `selected` makes an icon a toggle that flips the source you pass; `menuOpen` opens and closes a menu from code.\n- Icons added inside `menu` become its rows. A row with a `menu` of its own opens it in place of the list.\n  `menuStyle = \"Row\"` opens the menu sideways instead, as icons on the topbar's pill.\n- `input = { onSubmit = function(text) ... end }` gives an icon a text field that slides out of it like a row menu;\n  Enter submits it. As a menu row, or in the overflow menu, it opens a page with the field.\n- Images are `Content`: `image = Content.fromAssetId(123)`.\n- `mount` returns a function that removes the topbar. It takes `displayOrder`, `enabled`, `colorMode`,\n  `gamepadHighlightKey` (DPadUp by default) and `avoid`.\n- `avoid` takes GUI objects that other code puts on the topbar, such as another library's icons. Icons keep to the\n  widest stretch of the bar they leave free, and what no longer fits moves into the overflow menu.\n- Shift doesn't work as a shortcut modifier in games with shift lock, since Roblox takes it first. Use Ctrl or Alt.\n\nEvery prop is documented in `src/types.luau`, and shows in your editor's autocomplete.\n\n## Stories\n\nRun `wally install` and `rojo serve dev.project.json`, then open the VideTopbar storybook in\n[UI Labs](https://ui-labs.luau.page/), or press Play for a demo on the live topbar.\n\nFoundation, Builder Icons and the topbar's look are made by Roblox.\n","readmeTruncated":false}