{"id":28955643,"url":"https://github.com/cvaniak/cvaniakstextualwidgets","last_synced_at":"2025-09-22T18:55:08.935Z","repository":{"id":42173102,"uuid":"462373274","full_name":"Cvaniak/CvaniaksTextualWidgets","owner":"Cvaniak","description":"Package with list of diffrent widgets for Textual TUI","archived":false,"fork":false,"pushed_at":"2022-04-11T21:37:46.000Z","size":4250,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-21T20:37:51.995Z","etag":null,"topics":["bar","cvaniak","pip","python","rich","scroll","textual","tui","valuebar","widgets"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ck-widgets/","language":"Python","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/Cvaniak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-22T16:06:35.000Z","updated_at":"2025-05-11T07:13:27.000Z","dependencies_parsed_at":"2022-09-03T23:22:51.066Z","dependency_job_id":null,"html_url":"https://github.com/Cvaniak/CvaniaksTextualWidgets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cvaniak/CvaniaksTextualWidgets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cvaniak%2FCvaniaksTextualWidgets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cvaniak%2FCvaniaksTextualWidgets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cvaniak%2FCvaniaksTextualWidgets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cvaniak%2FCvaniaksTextualWidgets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cvaniak","download_url":"https://codeload.github.com/Cvaniak/CvaniaksTextualWidgets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cvaniak%2FCvaniaksTextualWidgets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261548744,"owners_count":23175497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bar","cvaniak","pip","python","rich","scroll","textual","tui","valuebar","widgets"],"created_at":"2025-06-23T20:09:06.762Z","updated_at":"2025-09-22T18:55:03.884Z","avatar_url":"https://github.com/Cvaniak.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CvaniaK's Widgets for Textual TUI (`ck_widgets`)\n\nThis is list of Widgets for [Textual](https://github.com/Textualize/textual) framework, created from my personal need.\n\n\u003e ⚠ **NOTE:** This project widgets names, arguments, etc. can vary along diffrent versions.\n\n# Install\nThis is pip package so you can install it using command below:\n```bash\npip3 install ck-widgets\n# or \npython3 -m pip install ck-widgets\n```\n\n# ValueBar\n![CoolBarGif](https://github.com/Cvaniak/CvaniaksTextualWidgets/blob/progress-bar/documentation/NiceValueBar.gif?raw=true)  \n\u003cdetails\u003e\n\u003csummary\u003eExamples\u003c/summary\u003e\n\nThe simples example:\n\n```python\n# Simples value bar\nfrom ck_widgets.widgets import ValueBarH, ValueBarV\nvbar_horizontal = ValueBarH(max_value=50)\n# or \nvbar_vertical = ValueBarV(max_value=50)\n```  \n\nAnd here is example with almost all arguments:\n\n![Example with many arguments](https://github.com/Cvaniak/CvaniaksTextualWidgets/blob/progress-bar/documentation/ValueBarArguments.png?raw=true)\n\n```python\n# Example with almost all arguments\nfrom ck_widgets.widgets import ValueBarH, CColor, CustomColor\nfrom rich import box\n\nbackground_color: List[CColor] = [\"rgb(0,0,0)\", \"rgb(0,0,0)\", \"yellow\"]\nValueBarH(\n    name=\"name_to_catch_in_event\",\n    label=\"Almost all arguments\",\n    label_align=\"left\",\n    label_position=\"bottom\",\n    start_value=25,\n    max_value=50,\n    height=6,\n    instant=True,\n    reversed=True,\n    color=CustomColor.gradient(\"green\", \"rgb(0, 100, 250)\"),\n    bg_color=background_color,\n    border_style=\"yellow\",\n    padding=(1,1),\n    box=box.DOUBLE_EDGE,\n)\n```  \n\nAnd this example:  \n![LotOfValueBars](https://github.com/Cvaniak/CvaniaksTextualWidgets/blob/main/documentation/FullUglyDemo.png?raw=true)\n\nyou can check code in this file `ck_widgets/exmples/value_bar.py` or test it by using command below:  \n\n```bash\npython3 -m ck_widgets.examples.value_bar\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eKnown Limitations\u003c/summary\u003e\n\n* You need to force size of layout to be not smaller than maximum size of of ValueBar (otherwise it will behave badly)\n* ...\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eTODO\u003c/summary\u003e\n\n* Reactive version (so it gives values from 0 to 1 and can be resized/'squashed')  \n* Be sure that provide all arguments  \n* Test edge cases  \n* Clean up how to provide color  \n* Label on left or right site  \n* ...\n\n\u003c/details\u003e\n\n\n# ListViewUo\n![Image](https://github.com/Cvaniak/CvaniaksTextualWidgets/blob/main/documentation/ListViewDemo.gif?raw=true)  \nWhile waiting for [ticket](https://github.com/Textualize/textual/projects/1#card-66941810) (also mentioned [here](https://github.com/Textualize/textual/discussions/196)) and official `ListView`, you can use this dirty version that allows you to scroll thrue list of widgets.  \n\n\u003cdetails\u003e\n\u003csummary\u003eExamples\u003c/summary\u003e\nYou can use it this way:\n\n```python\nfrom ck_widgets_lv import ListViewUo\n\nclass TestListView(App):\n    async def on_mount(self, event: events.Mount) -\u003e None:\n        await self.view.dock(ListViewUo([Placeholder(height=10) for _ in range(20)]))\n\nif __name__ == \"__main__\":\n    TestListView.run()\n```\n\nor more complex example (from gif demo above):\n```python\nfrom textual.widgets import Placeholder\nfrom textual.widget import Widget\nfrom textual.events import Message\nfrom textual.app import App\nfrom textual import events\n\nfrom ck_widgets.widgets import ListViewUo\n\nif __name__ == \"__main__\":\n    from textual.widgets import Footer\n\n    class DeleteStatus(Message):\n        def __init__(self, sender: Widget):\n            super().__init__(sender)\n            self.to_delete = sender\n\n    class DeletablePlaceholder(Placeholder):\n        async def on_click(self, event: events.Click) -\u003e None:\n            await self.emit(DeleteStatus(self))\n\n    class TestListView(App):\n        async def action_add(self) -\u003e None:\n            await self.list_view.add_widget(DeletablePlaceholder(height=10))\n            self.refresh()\n\n        async def action_add_index_2(self) -\u003e None:\n            await self.list_view.add_widget(DeletablePlaceholder(height=10), index=2)\n            self.refresh()\n\n        async def action_remove(self) -\u003e None:\n            await self.list_view.remove_widget_by_index()\n            self.refresh()\n\n        async def action_remove_index_2(self) -\u003e None:\n            await self.list_view.remove_widget_by_index(index=2)\n            self.refresh()\n\n        async def on_load(self, _: events.Load) -\u003e None:\n            await self.bind(\"a\", \"add()\", \"Add Widget\")\n            await self.bind(\"s\", \"add_index_2()\", \"Add Widget in index 2\")\n            await self.bind(\"r\", \"remove()\", \"Remove Widget\")\n            await self.bind(\"e\", \"remove_index_2()\", \"Remove Widget in index 2\")\n            await self.bind(\"Click Widget\", \"_()\", \"To delete it\")\n\n        async def on_mount(self, event: events.Mount) -\u003e None:\n            self.list_view = ListViewUo(\n                [DeletablePlaceholder(height=10) for _ in range(7)]\n            )\n\n            await self.view.dock(Footer(), edge=\"bottom\")\n            await self.view.dock(self.list_view)\n\n        async def handle_delete_status(self, message: DeleteStatus):\n            await self.list_view.remove_widget(message.to_delete)\n\n    TestListView.run()\n```\n\n\u003c/details\u003e\n\n# Change Log\n\n## [0.2.0] - 2022-04-11\n\n### Added\n* ListViewUo from previous [repo](https://github.com/Cvaniak/TextualListViewUnofficial)\n\n## [0.1.0] - 2022-02-26\n\n### Added\n* ValueBar\n* Test version of DebugWidget\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvaniak%2Fcvaniakstextualwidgets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvaniak%2Fcvaniakstextualwidgets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvaniak%2Fcvaniakstextualwidgets/lists"}