Skip to content

Commit cdafd6e

Browse files
feat: add new horizontal tabs navigation user experience (#18310)
* feat: Add none scrollable horizontal tab user experience Introduces `isHorizontal` and `isScrollable` properties to the Tabs component, allowing configuration of tab orientation and scrollability. Updates Blade, JS, and Alpine logic to support scrollable tabs with dropdown overflow handling and responsive behavior. * style: run composer cs * Refactor Tabs component and update related styles Refactored the Tabs component across PHP, Blade, and JS implementations to improve maintainability and consistency. Updated related CSS for dropdown list items to enhance UI appearance. These changes ensure better integration and user experience for tabbed interfaces. * Refactor tabs dropdown logic for improved visibility Replaces the scrollable tabs logic with a more robust dropdown visibility calculation. Updates Alpine component, Blade template, and supporting JS to use new withinDropdownMounted and isDropDownButtonVisible properties, ensuring correct tab visibility and dropdown trigger behavior. Removes unused tabIndex and related code, and cleans up CSS. * chore: fix code style * chore: fix code style * Add documentation for horizontal tabs usage Added a new section explaining how to use horizontal tabs, including details about the default scrollable behavior and the `horizontal()` method with its `scrollable` parameter. * Document horizontal tabs overflow behavior Added explanation for how non-scrollable horizontal tabs handle overflow by grouping excess tabs into a dropdown when space is limited. * chore: fix code style * clean up * Update tabs.blade.php * more robust calculation * chore: fix code style * Revert "chore: fix code style" This reverts commit 3acc6fe. * refactor and support badges * refactor php * Update tabs.blade.php * Update tabs.js * Update tabs.blade.php * screenshots --------- Co-authored-by: Abdulmajeed-Jamaan <[email protected]> Co-authored-by: Dan Harrin <[email protected]> Co-authored-by: danharrin <[email protected]>
1 parent 8f9380a commit cdafd6e

File tree

15 files changed

+1792
-1227
lines changed

15 files changed

+1792
-1227
lines changed

docs-assets/app/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ APP_NAME=Laravel
22
APP_ENV=ci
33
APP_KEY=base64:/RjsPfTKUG/cV+SQjSOfCfgFPZ85Zmwywiz5yevEZ0s=
44
APP_DEBUG=true
5-
APP_URL=http://127.0.0.1::8000
5+
APP_URL=http://127.0.0.1:8000
66

77
LOG_CHANNEL=stack
88
LOG_DEPRECATIONS_CHANNEL=null

docs-assets/app/app/Livewire/Schemas/LayoutDemo.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,28 @@ public function form(Schema $form): Schema
284284
])
285285
->vertical(),
286286
]),
287+
Group::make()
288+
->id('tabsNotScrollable')
289+
->extraAttributes([
290+
'class' => 'p-16 max-w-xl',
291+
])
292+
->schema([
293+
Tabs::make('Tabs')
294+
->statePath('tabsNotScrollable')
295+
->schema([
296+
Tab::make('Tab 1')
297+
->schema([
298+
TextInput::make('field'),
299+
]),
300+
Tab::make('Tab 2'),
301+
Tab::make('Tab 3'),
302+
Tab::make('Tab 4'),
303+
Tab::make('Tab 5'),
304+
Tab::make('Tab 6'),
305+
Tab::make('Tab 7'),
306+
])
307+
->scrollable(false),
308+
]),
287309
Group::make()
288310
->id('wizard')
289311
->extraAttributes([

0 commit comments

Comments
 (0)