Function
Tab
({ value, label, startAdornment, badge, onClick, isActive, disabled }: TabProps)
Source from the content-addressed store, hash-verified
| 36 | } |
| 37 | |
| 38 | export function Tab({ value, label, startAdornment, badge, onClick, isActive, disabled }: TabProps) { |
| 39 | return ( |
| 40 | <li role='presentation'> |
| 41 | <Button |
| 42 | variant='text-default' |
| 43 | className={clsxMerge(tabVariants({ isActive, disabled }))} |
| 44 | id={`tab-${value}`} |
| 45 | role='tab' |
| 46 | aria-controls={kebabCase(`tab-panel-${value}`)} |
| 47 | aria-selected={isActive} |
| 48 | onClick={() => { |
| 49 | onClick(value); |
| 50 | }} |
| 51 | disabled={disabled} |
| 52 | startAdornment={startAdornment} |
| 53 | endAdornment={ |
| 54 | badge ? ( |
| 55 | <Badge |
| 56 | variant={isActive ? 'primary' : 'secondary'} |
| 57 | className={disabled ? 'border-transparent bg-slate-100 text-slate-400' : ''} |
| 58 | {...badge} |
| 59 | /> |
| 60 | ) : undefined |
| 61 | } |
| 62 | tabIndex={0} |
| 63 | > |
| 64 | {label} |
| 65 | </Button> |
| 66 | </li> |
| 67 | ); |
| 68 | } |
| 69 | |
| 70 | Tab.displayName = 'Tab'; |
Callers
nothing calls this directly
Tested by
no test coverage detected