TabItem class
A single tab item component in the Alter Design System.
Note: TabItem is intended to be used as a sub-component within Tabs
and can also be used individually.
Figma Specifications (Node 336:10501 - .TabItem):
- Variants:
state=Active, type=Gray(336:10500): FillbaseNeutral/baseGray(#F9FAFB), Text/IcontextPrimary(#000000)state=Active, type=White(336:10504): FillbaseWhite(#FFFFFF), Text/IcontextPrimary(#000000)state=Default, type=Gray(336:10502): Filltransparent, Text/IcontextDisabled(#99A1AF)state=Default, type=White(336:10506): Filltransparent, Text/IcontextDisabled(#99A1AF)
- Typography:
Body/body-lg-> AlterTypography.bodyLg (Geist 16px, Regular 400, line-height 20px) - Padding: 12px vertical, 16px horizontal
- Gap: 8px between icon and label
- Border Radius: 24px
- Inheritance
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasIcon → bool
-
Whether the tab item displays a leading icon.
final
- hasLabel → bool
-
Whether the text label should be visible.
final
- icon → IconData?
-
Icon data for the leading icon when hasIcon is true.
final
- iconWidget → Widget?
-
Custom icon widget override.
final
- isSelected → bool
-
Whether this tab is currently active/selected.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String
-
Text label displayed in the tab.
final
- onTap → VoidCallback?
-
Callback executed when the tab item is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → TabItemType
-
Visual theme style type.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- version → const String
- Component version for reference. v1.1.0: Aligned with live Figma Node 336:10501 (.TabItem): Added hasIcon (default false), icon (default Icons.face_5_outlined), iconWidget, and hasLabel (default true) supporting icon-only, label-only, and icon+label composite tabs. v1.0.2: Removed Center widget inside AnimatedContainer so TabItem strictly hugs intrinsic height (44px) rather than expanding vertically. v1.0.1: Fixed color lerp flash artifact when transitioning from transparent by preserving RGB channels and removed jarring InkWell highlight overlay. v1.0.0: Initial release matching Figma Node 336:10501 (.TabItem).