Hacktron Design System

Tabs

A segmented control for switching between views of the same content.

<template>  <Tabs    v-model="active"    :items="[{ label: 'Overview', value: 'overview' }, { label: 'Activity', value: 'activity' }]"    :content="false"    color="neutral"  /></template>

Props

Name Type Default
items{ label?, value?, icon?, avatar?, badge?, disabled?, ... }[]-
modelValuestring | number-
contentbooleantrue (UTabs's own default)
blockbooleanfalse
labelstring-
...propsUTabs props (color, size, orientation, unmountOnHide, valueKey, labelKey, ...)-

Guidelines

Do

  • Use for a segmented filter control switching between views of the same data.
  • Use block when the control spans its container (an either-or choice in a form) so every segment is the same width.
  • Pass label so the control has an accessible name; there is no visible label on a tab strip.

Don't

  • Don't use tabs to step through a sequential, ordered flow - use Stepper or StepperVertical instead.
  • Don't hide destructive or primary actions behind a tab a user might not think to check.

Examples

Block

`block` stretches the control across its container and gives every segment the same width, whatever the label length. For an either-or choice in a form; leave it off for a content-sized filter bar.

<template>  <Tabs    v-model="choice"    :items="[{ label: 'GitHub App', value: 'app' }, { label: 'Personal access token', value: 'pat' }]"    :content="false"    color="neutral"    block  /></template>