Skip to content

Conversation

@Haviles04
Copy link
Contributor

@Haviles04 Haviles04 commented Jan 8, 2026

    <Tabs.Root v-model="selected">
      <Tabs.List
        label="Filter"
        class="inline-flex gap-1 p-1 bg-gray-100 dark:bg-gray-800 rounded-lg m-auto"
      >
        <Tabs.Tab
          v-for="tab in ['all', 'active', 'completed']"
          :key="tab"
          v-slot="{ isSelected }"
          :value="tab"
        >
          <button
            class="px-3 py-1.5 text-sm font-medium rounded-md transition-colors"
            :class="
              isSelected
                ? 'bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm'
                : 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white'
            "
          >
            {{ tab.charAt(0).toUpperCase() + tab.slice(1) }}
          </button>
        </Tabs.Tab>
      </Tabs.List>

      <Tabs.Panel value="all" class="mt-4">All items</Tabs.Panel>
      <Tabs.Panel value="active" class="mt-4">Active items</Tabs.Panel>
      <Tabs.Panel value="completed" class="mt-4">Completed items</Tabs.Panel>
    </Tabs.Root>
</template>

<script setup lang="ts">
import { Tabs } from '#v0';

const selected = ref([]);

</script>

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 8, 2026

Open in StackBlitz

commit: 455f6f3

@Haviles04 Haviles04 requested a review from johnleider January 8, 2026 23:48
Haviles04 and others added 12 commits January 14, 2026 09:10
Fix inverted condition in TabsPanel that prevented proper ticket lookup by value.
The condition checked for empty results (=== 0) when it should check for matches (> 0),
causing panels to receive incorrect IDs and breaking aria-controls/aria-labelledby
relationships with their corresponding tabs.

Fixes tests:
- "should have correct ARIA attributes"
- "should match aria-controls and aria-labelledby"

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove unsafe type assertion in TabsPanel ticket lookup
- Change onBeforeUnmount to onUnmounted for consistency with Radio
- Add template ref for focus management instead of DOM queries
- Add TabsTicket interface with el property for focus tracking
- Add edge case tests: empty/single tabs, all-disabled, dynamic lifecycle
- Add loop=false boundary behavior tests
@johnleider johnleider force-pushed the haviles04/feat-new-tab-component branch from 1691d65 to 0275456 Compare January 14, 2026 15:24
- Rename TabsTab.vue to TabsItem.vue and update all exports/types
- Add inheritAttrs: false and useAttrs() pattern to TabsList, TabsItem, TabsPanel
- Add aria-label, aria-labelledby, aria-describedby props to TabsItem
- Add data-disabled attribute to TabsList
- Remove redundant Readonly wrappers from TabsContext interface
- Add documentation page and basic example
@johnleider johnleider merged commit 6c601b2 into master Jan 14, 2026
11 of 13 checks passed
@johnleider johnleider deleted the haviles04/feat-new-tab-component branch January 14, 2026 18:04
@johnleider johnleider added this to the v0.1.0 milestone Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants