Package: aiogram-widgets
aiogram_widgetsCreate most popular widgets for aiogram 3x in a few code lines🔗 LinksFeaturesFully customizable widgetsStatelessAutomatic handlingSupports aiogram ^3.0.0b1RoadmapCheckboxes and multiselectCalendarAiogram 2x supportChangelogVersion 1.2.7:Fixed a bug that still requiredpagination_keyoptionVersion 1.2.6:Fixed a bug that caused uncompability in python versions 3.10 and lowerVersion 1.2.5:Added the ability to adjust buttons passing tuple of sizes (works the similar way as in InlineKeyboardBuilder.adjust) in keyboard paginationVersion 1.2.4:Fixed aiogram dependency bugVersion 1.2.3:Fixed typings at Python 3.9pagination_keyoption now is not requiredBetter types namingVersion 1.2.2:Custom pagination keyboard supportAiogram 3.0.0b8 supportREADME with more examplesLive bot example with source codeBetter types namingInstallationPip:pipinstallaiogram_widgetsPoetry:poetryaddaiogram_widgets🤖Bot example|Bot source code⚙️Usage/ExamplesSimple keyboard paginationfromaiogram_widgets.paginationimportKeyboardPaginator@router.message(F.text=="/keyboard_pagination")asyncdefkeyboard_pagination(message:Message):buttons=[InlineKeyboardButton(text=f"Button{i}",callback_data=f"button_{i}")foriinrange(1,1001)]paginator=KeyboardPaginator(data=buttons,per_page=20,per_row=2)awaitmessage.answer(text="Keyboard pagination",reply_markup=paginator.as_markup())Keyboard pagination with additional buttons (Same with text pagination)fromaiogram_widgets.paginationimportKeyboardPaginator@router.message(F.text=="/kb_additional_buttons")asyncdefkb_additional_buttons(message:Message):buttons=[InlineKeyboardButton(text=f"Button{i}",callback_data=f"button_{i}")foriinrange(1,1001)]additional_buttons=[[InlineKeyboardButton(text="Go back 🔙",callback_data="go_back"),]]paginator=KeyboardPaginator(data=buttons,additional_buttons=additional_buttons,per_page=20,per_row=2)awaitmessage.answer(text="Keyboard pagination with additional buttons",reply_markup=paginator.as_markup(),)Keyboard pagination with custom pagination buttons (Same with text pagination)@router.message(F.text=="/kb_custom_pagination")asyncdefkb_custom_pagination(message:Message):text_data=[f"I am string number{i}"foriinrange(1,1001)]pagination_buttons=[None,"<-","->",None]paginator=TextPaginator(data=text_data,pagination_buttons=pagination_buttons,)current_text_chunk,reply_markup=paginator.current_message_dataawaitmessage.answer(text=current_text_chunk,reply_markup=reply_markup,)Simple text paginationfromaiogram_widgets.paginationimportTextPaginator@router.message(F.text=="/text_pagination")asyncdeftext_pagination(message:Message):text_data=[f"I am string number{i}"foriinrange(1,1001)]paginator=TextPaginator(data=text_data,)current_text_chunk,reply_markup=paginator.current_message_dataawaitmessage.answer(text=current_text_chunk,reply_markup=reply_markup,)Text pagination with custom join@router.message(F.text=="/text_join")asyncdeftext_custom_join(message:Message):text_data=[f"I am string number{i}"foriinrange(1,1001)]paginator=TextPaginator(data=text_data,join_symbol="\n\n",)current_text_chunk,reply_markup=paginator.current_message_dataawaitmessage.answer(text=current_text_chunk,reply_markup=reply_markup,)FeedbackI would be very pleased for a star ⭐️