Tabs constructor
Tabs({})
Creates a tablist from tabs.
Implementation
Tabs({
List<TabItem> tabs = const [],
String? activeKey,
NavVariant variant = NavVariant.underline,
Tone tone = Tone.primary,
ComponentSize size = ComponentSize.md,
String? className,
Map<String, Object?> props = const {},
Map<String, Object?> style = const {},
DartStyle? dartStyle,
void Function(Object event, TabItem tab)? onChanged,
}) : super(
'div',
props: mergeComponentProps(
{...props, 'role': props['role'] ?? 'tablist'},
className: className,
defaultStyle: const {
'display': 'flex',
'align-items': 'center',
'gap': '4px',
'border-bottom': '1px solid #e4e7ec',
},
dartStyle: dartStyle,
style: style,
),
children: [
for (final tab in tabs)
_tabButton(
tab,
selected: tab.key == activeKey,
variant: variant,
tone: tone,
size: size,
onChanged: onChanged,
),
],
);