Skip to content

Commit

Permalink
feat(Tabs): allow string for TabItem counter value (#1989)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorKluch authored Dec 13, 2024
1 parent 555b186 commit b628086
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Tabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ LANDING_BLOCK-->
| meta | Tab description | `string` | |
| hint | HTML title attribute | `string` | |
| icon | Icon displayed at the start | `React.ReactNode` | |
| counter | Number displayed at the end | `React.ReactNode` | |
| counter | Number displayed at the end | `number` `string` | |
| label | `<Label>` displayed at the end | `React.ReactNode` | |
| disabled | Inactive state | `boolean` | |

Expand Down
4 changes: 2 additions & 2 deletions src/components/Tabs/TabsItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface TabsItemProps {
disabled?: boolean;
hasOverflow?: boolean;
icon?: React.ReactNode;
counter?: number;
counter?: number | string;
label?: {
content: React.ReactNode;
theme?: LabelProps['theme'];
Expand Down Expand Up @@ -100,7 +100,7 @@ export function TabsItem({
<div className={b('item-content')}>
{icon && <div className={b('item-icon')}>{icon}</div>}
<div className={b('item-title')}>{title || id}</div>
{typeof counter === 'number' && <div className={b('item-counter')}>{counter}</div>}
{counter !== undefined && <div className={b('item-counter')}>{counter}</div>}
{label && (
<Label className={b('item-label')} theme={label.theme}>
{label.content}
Expand Down

0 comments on commit b628086

Please sign in to comment.