{"id":50567926,"url":"https://github.com/nimblemarkets/ntemoji","last_synced_at":"2026-06-04T16:01:23.825Z","repository":{"id":360092324,"uuid":"1248604515","full_name":"NimbleMarkets/ntemoji","owner":"NimbleMarkets","description":"Nimbe Terminal Emoji Golang module","archived":false,"fork":false,"pushed_at":"2026-05-24T23:50:51.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-25T01:34:26.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NimbleMarkets.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-24T21:23:48.000Z","updated_at":"2026-05-24T23:50:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/NimbleMarkets/ntemoji","commit_stats":null,"previous_names":["nimblemarkets/ntemoji"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/NimbleMarkets/ntemoji","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleMarkets%2Fntemoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleMarkets%2Fntemoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleMarkets%2Fntemoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleMarkets%2Fntemoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NimbleMarkets","download_url":"https://codeload.github.com/NimbleMarkets/ntemoji/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimbleMarkets%2Fntemoji/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33912343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-04T16:01:21.227Z","updated_at":"2026-06-04T16:01:23.771Z","avatar_url":"https://github.com/NimbleMarkets.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ntemoji — Emoji picker and swatch keyboard overlay for Bubble Tea\n\n\u003cp\u003e\n    \u003ca href=\"https://github.com/NimbleMarkets/ntemoji/tags\"\u003e\u003cimg src=\"https://img.shields.io/github/tag/NimbleMarkets/ntemoji.svg\" alt=\"Latest Release\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pkg.go.dev/github.com/NimbleMarkets/ntemoji?tab=doc\"\u003e\u003cimg src=\"https://godoc.org/github.com/golang/gddo?status.svg\" alt=\"GoDoc\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/NimbleMarkets/ntemoji/blob/main/CODE_OF_CONDUCT.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg\"  alt=\"Code Of Conduct\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n`ntemoji` is a [Bubble Tea](https://github.com/charmbracelet/bubbletea) widget that provides a keyboard- and mouse-enabled emoji picker overlay keypad for terminal user interfaces (TUIs). \n\nIt features curated categories of TUI-safe, highly compatible emojis, support for custom palettes, search/filter capabilities, preset shortcuts, and positioning integration via [`bubble-overlay`](https://github.com/madicen/bubble-overlay) and [`bubblezone`](https://github.com/lrstanley/bubblezone).\n\n[Try out the live WASM demo.](https://nimblemarkets.github.io/ntemoji)\n\nThis module was inspired by the [@madicen's `bubble-color-picker` library](https://github.com/madicen/bubble-color-picker).\n\n## Quickstart\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/NimbleMarkets/ntemoji\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\tzone \"github.com/lrstanley/bubblezone\"\n)\n\ntype model struct {\n\tpicker ntemoji.Model\n\tzm     *zone.Manager\n}\n\nfunc (m model) Init() tea.Cmd { return nil }\n\nfunc (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {\n\tswitch msg := msg.(type) {\n\tcase tea.KeyMsg:\n\t\tif msg.String() == \"q\" || msg.String() == \"ctrl+c\" {\n\t\t\treturn m, tea.Quit\n\t\t}\n\tcase ntemoji.EmojiChangedMsg:\n\t\tfmt.Printf(\"Selected emoji: %s\\n\", msg.Emoji)\n\t\treturn m, tea.Quit\n\tcase ntemoji.EmojiCanceledMsg:\n\t\treturn m, tea.Quit\n\t}\n\n\tvar cmd tea.Cmd\n\tupdated, cmd := m.picker.Update(msg)\n\tm.picker = updated.(ntemoji.Model)\n\treturn m, cmd\n}\n\nfunc (m model) View() string {\n\treturn m.zm.Scan(m.picker.View())\n}\n\nfunc main() {\n\tzm := zone.New()\n\tpicker := ntemoji.New(\n\t\tntemoji.WithInitialEmoji(\"🚀\"),\n\t\tntemoji.WithPresets([]string{\"😀\", \"👍\", \"🔥\", \"✅\", \"❌\"}),\n\t\tntemoji.WithShowSearch(true),\n\t)\n\tpicker.SetZoneManager(zm)\n\n\tp := tea.NewProgram(model{picker: picker, zm: zm}, tea.WithAltScreen(), tea.WithMouseAllMotion())\n\tif _, err := p.Run(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n}\n```\n\n## SwatchPicker (Popup Modal overlay)\n\nThe `SwatchPicker` is a small UI component representing the selected emoji with a dropdown arrow (e.g. `😀 ▼`). Clicking it opens the full emoji keyboard popup centered on the button.\n\n1. **Create the swatch**: `swatch := ntemoji.NewSwatchPicker(\"🚀\", \"Trigger\")`\n2. **Setup bubblezone**: `swatch.SetZoneManager(zm)`\n3. **Set bounds \u0026 render**: call `swatch.SetBounds(row, col, width, height)` and wrap with overlay rendering:\n   ```go\n   mainView = swatch.ViewWithOverlay(mainView, width, height)\n   return zm.Scan(mainView)\n   ```\n4. **Update**: forward key and mouse events to the open swatch.\n\n## Keyboard \u0026 Mouse Interactions\n\n- **Tab / Shift+Tab**: Cycle focus among the **Presets row**, **Search bar**, **Category selectors**, and the **Emoji grid**.\n- **Arrows / hjkl**: Navigate selections within the active presets or the emoji grid. Changing focus to category selection and using ←/→ instantly switches category tabs.\n- **Enter**: Confirms the selected emoji and fires an `EmojiChangedMsg`.\n- **Escape**: Cancels selection and fires an `EmojiCanceledMsg`.\n- **Mouse clicks**: Clicking any category tab switches categories. Hovering over presets/grid items highlights them, and releasing the left-click selects the emoji.\n\n## Configuration Options\n\nConstruct the emoji picker with **`New(...Option)`**:\n\n| Option | Purpose |\n|--------|---------|\n| `WithInitialEmoji(emoji)` | Sets the starting emoji (auto-focuses it in grid/presets). |\n| `WithPresets([]string)` | Shows a row of quick-select preset emojis above search/categories. |\n| `WithPalettes([]Palette)` | Supplies custom emoji lists and category tabs. |\n| `WithStyle(lipgloss.Style)` | Configures custom outer frame border and padding. |\n| `WithAutoDismiss(bool)` | When true, selection includes `Dismiss: true` to auto-hide the modal. |\n| `WithShowSearch(bool)` | Toggles the search input box for matching keywords. |\n\n## TUI Emoji Compatibility \u0026 Box-Sizing\n\nEmojis are generally 2 columns wide in terminal user interfaces. However, some emojis (such as those containing the variation selector `\\ufe0f`, e.g., `⚠️` or `🌧️`) report a width of **2** columns under standard Go string-width libraries (like Lip Gloss / `uniseg`), but render as only **1** column wide on standard terminal emulators.\n\nWhen designing custom palettes or presets for terminal widgets like `ntemoji`, this discrepancy causes right-border layout alignment shifts (as the terminal renders the row narrower than Lip Gloss's box-sizing layout calculations).\n\nTo guarantee pixel-perfect rectangular borders in all terminal environments:\n- **Only use standard 2-column emojis** where `lipgloss.Width` and terminal rendering widths agree.\n- **Avoid variation selectors** (`\\ufe0f`) in custom emoji palettes.\n- All default palettes in `ntemoji` are pre-curated to strictly include safe, matching 2-column emojis.\n\n## Demos\n\nBuilt-in demo examples compile out-of-the-box:\n\n```sh\n# Run full-screen demo\ntask build-ex-simple\n./bin/simple\n\n# Run multi-swatch grid overlay demo\ntask build-ex-swatch\n./bin/swatch\n```\n\n## Vibe coded\n\nThis comment was inserted by a human.  Except it wasn't, but then it was reviewed and I wrote this.\n\n## License\n\n[MIT License](./LICENSE.txt) — Copyright (c) 2026 [Neomantra Corp](https://www.neomantra.com).\n\n----\nMade with :heart: and :fire: by the team behind [Nimble.Markets](https://nimble.markets).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimblemarkets%2Fntemoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimblemarkets%2Fntemoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimblemarkets%2Fntemoji/lists"}