Badge

Badge is used to display numeric status data.

Generally available

The new badge appearances are stable and ready for adoption. Visual updates are currently behind the platform-dst-lozenge-tag-badge-visual-uplifts feature flag.

21.2.2

Patch Changes

  • Updated dependencies

21.2.1

Patch Changes

  • Updated dependencies

21.2.0

Minor Changes

  • bd2c5b0112185, (opens new window) - Remove stale API report artifacts from published Platform packages.

Patch Changes

  • Updated dependencies

21.1.0

Minor Changes

  • d82e6f76528ab, (opens new window) - Add direct subpath package exports as part of the linking-platform, search, media, and design-system barrel-removal (de-barrel) migration.

    These packages now expose their individual modules via explicit package.json exports subpaths so that consumers can import directly from the leaf module (e.g. @atlaskit/pkg/thing) instead of the package barrel/index. This adds new public entry points without changing or removing any existing exports, so it is a backwards-compatible additive change.

    No runtime behaviour changes; this is an API-surface (entry-point) addition to support tree-shaking and to unblock removal of the barrel index files.

Patch Changes

  • Updated dependencies

21.0.2

Patch Changes

21.0.1

Patch Changes

21.0.0

Major Changes

  • 48e7d03469b80, (opens new window) - Apply Volt entry-point and barrel-removal standards across these design-system packages. Public exports now resolve directly to ./src/* implementations instead of intermediate ./src/entry-points/* re-exports, root barrels and remaining entry-point shims are marked deprecated in favour of per-export subpaths, and a few new subpaths are added (@atlaskit/badge/badge-new, @atlaskit/tile/tile-skeleton, @atlaskit/popper/main, @atlaskit/section-message/message, @atlaskit/section-message/message-action).

    Why this is breaking

    Subpaths and the package root can now resolve to the same module instance. Consumers that deep-imported entry-points/*, or jest.mock()'d a specific subpath may need updates. @atlaskit/image's root export now points at ./src/ui/image/index.tsx. @atlaskit/checkbox/checkbox now exports a named Checkbox from the implementation module (default export retained for backwards compatibility).

    Migration

    Prefer published subpaths over the package root:

    import { Checkbox } from '@atlaskit/checkbox/checkbox'; import TextField from '@atlaskit/textfield/text-field'; import Popup from '@atlaskit/popup/popup'; import SectionMessage from '@atlaskit/section-message/message'; import EmptyState from '@atlaskit/empty-state/empty-state';

    If you imported through internal entry-point modules, switch to the public subpath:

    -import Checkbox from '@atlaskit/checkbox/entry-points/checkbox'; +import { Checkbox } from '@atlaskit/checkbox/checkbox';

Patch Changes

  • Updated dependencies

20.0.0

Major Changes

  • ca3de4beeea48, (opens new window) - Apply Volt entry-point and multi-export standards via volt-migrate-package. This is a major change to @atlaskit/badge: the package exports map has been restructured so every public subpath now resolves directly to its ./src/* implementation instead of going through an intermediate ./src/entry-points/* re-export. No public subpaths were removed.

    Why this is breaking

    Because each subpath now points straight at its implementation module, a subpath and the package root can resolve to the same module instance. Consumers that deep-import the internal entry-points/* files, or that jest.mock() a specific subpath, may observe changed resolution/behaviour and need updating.

    Migration — public imports are unchanged

    Importing the published subpaths (or the package root) continues to work as before:

    // Still valid — no change required import Badge from '@atlaskit/badge/badge';

    If you were reaching into the internal entry-point modules, switch to the public subpath:

    -import Badge from '@atlaskit/badge/entry-points/badge'; +import Badge from '@atlaskit/badge/badge';

    Before / after exports map

    "exports": { ".": "./src/index.tsx", - "./badge": "./src/entry-points/badge.tsx", + "./badge": "./src/badge.tsx", "./new": "./src/entry-points/new.tsx", - "./types": "./src/entry-points/types.tsx", + "./types": "./src/types.tsx", }

Patch Changes

  • Updated dependencies

19.1.3

Patch Changes

  • Updated dependencies

19.1.2

Patch Changes

  • Updated dependencies

19.1.1

Patch Changes

  • Updated dependencies

19.1.0

Minor Changes

  • cd097a2111788, (opens new window) - Republish packages depending on @atlaskit/react-compiler-gating so their published dependency reference is updated to the renamed @atlaskit/react-compiler-gating scope.

    The earlier rename of @atlassian/react-compiler-gating to @atlaskit/react-compiler-gating only bumped the renamed package itself, so dependent packages were never republished and their published versions still referenced the old @atlassian/react-compiler-gating name, which is not available in the public npm registry. This minor bump republishes all affected packages with the corrected dependency.

Patch Changes

  • Updated dependencies

19.0.2

Patch Changes

  • e13ee97cc69a4, (opens new window) - Fixed the legacy-appearance fallback for the dangerBold Badge appearance to map to important instead of removed. When the platform-dst-lozenge-tag-badge-visual-uplifts feature gate is off, dangerBold now falls back to the same legacy appearance the existing red danger Badge has always used, preserving the previous visual look for consumers that haven't migrated yet.

19.0.1

Patch Changes

19.0.0

Major Changes

  • f2dc9097319f0, (opens new window) - ### Dropped support for legacy Typescript 4 types. Typescript 5 is now the new minimum.

    Removes the typesVersions property and dist/types-ts4.5 directory from the dist.

    Types are now exclusively via the "types": "dist/types/index.d.ts" property.

    - "typesVersions": { - ">=4.5 <4.9": { - "*": [ - "dist/types-ts4.5/*", - "dist/types-ts4.5/index.d.ts" - ] - } - },

Patch Changes

  • Updated dependencies

18.7.1

Patch Changes

18.7.0

Minor Changes

  • bb9a7cf0620fa, (opens new window) - Added 5 new bold semantic Badge appearances behind the platform-dst-lozenge-tag-badge-visual-uplifts feature gate: successBold, dangerBold, warningBold, informationBold, and discoveryBold.

    These bold appearances use the new color.background.<semantic>.subtle tokens (introduced in @atlaskit/tokens@13.2.0) as the background and pair with color.text.<semantic>.bolder text for stronger visual prominence than the existing subtle semantic appearances. The legacy appearanceMapping and appearanceMappingToOld helpers route the new appearances correctly when the feature gate is off.

Patch Changes

  • Updated dependencies

18.6.0

Minor Changes

18.5.0

Minor Changes

  • 52b7aa6b3d721, (opens new window) - Added a new /new entrypoint for @atlaskit/lozenge, @atlaskit/badge, and @atlaskit/tag. These entrypoints export the new visual refresh components directly, bypassing the platform-dst-lozenge-tag-badge-visual-uplifts feature flag. This is intended for products that don't have Statsig integrated and cannot evaluate the feature flag.

    New entrypoints:

    • import Lozenge from '@atlaskit/lozenge/new'
    • import Badge from '@atlaskit/badge/new'
    • import Tag from '@atlaskit/tag/new'

    Note: Do not use the /new entrypoint if your app can evaluate the platform-dst-lozenge-tag-badge-visual-uplifts feature flag. These entrypoints will be removed after the visual uplift rollout is complete, which will require updating import paths back to the default entrypoint.

18.4.6

Patch Changes

  • Updated dependencies

18.4.5

Patch Changes

18.4.4

Patch Changes

  • Updated dependencies

18.4.3

Patch Changes

18.4.2

Patch Changes

18.4.1

Patch Changes

18.4.0

Minor Changes

  • 6d33a20db82a1, (opens new window) - [ux] Changed the badge background to use subtler semantic tokens (the new badge is still behind a feature flag platform-dst-lozenge-tag-badge-visual-uplifts).

18.3.4

Patch Changes

  • Updated dependencies

18.3.3

Patch Changes

  • Updated dependencies

18.3.2

Patch Changes

18.3.1

Patch Changes

  • Updated dependencies

18.3.0

Minor Changes

18.2.4

Patch Changes

  • Updated dependencies

18.2.3

Patch Changes

  • Updated dependencies

18.2.2

Patch Changes

  • Updated dependencies

18.2.1

Patch Changes

  • Updated dependencies

18.2.0

Minor Changes

  • 2f3c3d27e42b2, (opens new window) - [ux] Updates badge styles to reflect our new visual design language. These changes were previously behind a feature flag and are now fully rolled out.

18.1.6

Patch Changes

18.1.5

Patch Changes

18.1.4

Patch Changes

  • Updated dependencies

18.1.3

Patch Changes

  • Updated dependencies

18.1.2

Patch Changes

18.1.1

Patch Changes

18.1.0

Minor Changes

18.0.0

Major Changes

Patch Changes

  • Updated dependencies

17.2.0

Minor Changes

Patch Changes

  • Updated dependencies

17.1.2

Patch Changes

17.1.1

Patch Changes

  • Updated dependencies

17.1.0

Minor Changes

Patch Changes

  • Updated dependencies

17.0.2

Patch Changes

17.0.1

Patch Changes

17.0.0

Major Changes

  • #102595, (opens new window) d7f60cd2fb693, (opens new window) - Migrated from @emotion/react to @compiled/react in order to improve performance, align with the rest of the Atlaskit techstack, and support React 18 Streaming SSR.

    Please note, in order to use this version of @atlaskit/badge, you will need to ensure that your bundler is configured to handle .css imports correctly. Most bundlers come with built-in support for .css imports, so you may not need to do anything. If you are using a different bundler, please refer to the documentation for that bundler to understand how to handle .css imports.

16.4.4

Patch Changes

  • Updated dependencies

16.4.3

Patch Changes

16.4.2

Patch Changes

  • Updated dependencies

16.4.1

Patch Changes

  • Updated dependencies

16.4.0

Minor Changes

  • #127511, (opens new window) db30e29344013, (opens new window) - Widening range of react and react-dom peer dependencies from ^16.8.0 || ^17.0.0 || ~18.2.0 to the wider range of ``^16.8.0 || ^17.0.0 || ^18.0.0` (where applicable).

    This change has been done to enable usage of react@18.3 as well as to have a consistent peer dependency range for react and react-dom for /platform packages.

Patch Changes

  • Updated dependencies

16.3.2

Patch Changes

  • Updated dependencies

16.3.1

Patch Changes

  • Updated dependencies

16.3.0

Minor Changes

16.2.3

Patch Changes

  • Updated dependencies

16.2.2

Patch Changes

  • Updated dependencies

16.2.1

Patch Changes

  • Updated dependencies

16.2.0

Minor Changes

Patch Changes

  • Updated dependencies

16.1.2

Patch Changes

  • Updated dependencies

16.1.1

Patch Changes

  • Updated dependencies

16.1.0

Minor Changes

16.0.0

Major Changes

  • #88033, (opens new window) 8c3fac87dcc9, (opens new window) - Badge now sets specific font size, line height, font style, and font family properties under the hood. If you previously had Badge wrapped with elements like <em> or <strong> that specify font style or font weight properties, there will be a visual difference as these styles are overriden within Badge. Avoid wrapping Badge in elements that modify text properties.

    If you need to preserve these styles, wrap the children of Badge instead, for example: <Badge><em>1</em></Badge>. Please note however this is not fully supported and will not work with the max prop.

15.3.0

Minor Changes

Patch Changes

  • Updated dependencies

15.2.7

Patch Changes

15.2.6

Patch Changes

  • Updated dependencies

15.2.5

Patch Changes

15.2.4

Patch Changes

  • Updated dependencies

15.2.3

Patch Changes

  • Updated dependencies

15.2.2

Patch Changes

  • Updated dependencies

15.2.1

Patch Changes

15.2.0

Minor Changes

15.1.16

Patch Changes

15.1.15

Patch Changes

  • Updated dependencies

15.1.14

Patch Changes

15.1.13

Patch Changes

15.1.12

Patch Changes

15.1.11

Patch Changes

  • Updated dependencies

15.1.10

Patch Changes

  • Updated dependencies

15.1.9

Patch Changes

  • Updated dependencies

15.1.8

Patch Changes

15.1.7

Patch Changes

  • Updated dependencies

15.1.6

Patch Changes

15.1.5

Patch Changes

15.1.4

Patch Changes

15.1.3

Patch Changes

15.1.2

Patch Changes

15.1.1

Patch Changes

15.1.0

Minor Changes

Patch Changes

  • Updated dependencies

15.0.23

Patch Changes

15.0.22

Patch Changes

15.0.21

Patch Changes

15.0.20

Patch Changes

15.0.19

Patch Changes

15.0.18

Patch Changes

15.0.17

Patch Changes

15.0.16

Patch Changes

15.0.15

Patch Changes

15.0.14

Patch Changes

15.0.13

Patch Changes

  • Updated dependencies

15.0.12

Patch Changes

15.0.11

Patch Changes

  • Updated dependencies

15.0.10

Patch Changes

  • Updated dependencies

15.0.9

Patch Changes

  • Updated dependencies

15.0.8

Patch Changes

15.0.7

Patch Changes

  • Updated dependencies

15.0.6

Patch Changes

15.0.5

Patch Changes

  • Updated dependencies

15.0.4

Patch Changes

  • Updated dependencies

15.0.3

Patch Changes

  • Updated dependencies

15.0.2

Patch Changes

  • Updated dependencies

15.0.1

Patch Changes

  • Updated dependencies

15.0.0

Major Changes

  • #12837, (opens new window) 942dd25df09, (opens new window) - In this version we made Badge dramatically faster and lighter.

    • General performance improvements.

    • We are now exporting a new style prop which you can use to pass a custom backgroundColor and color.

    • You can now pass ReactNode instead of string as children; however, Badge should only be used in cases where you want to represent a number. If the value is number, we will use existing formatting based on the max prop, otherwise the value will get rendered as it is.

    • [BREAKING] We have removed the deprecated theme prop. Please use a combination of appearance and style prop for custom theming.

    Before:

    import Badge from '@atlaskit/badge'; type GetThemeTokensFn<ThemeTokens, ThemeProps> = (props: ThemeProps) => ThemeTokens; function themeGetterFunction<ThemeTokens, ThemeProps>( getTokens: GetThemeTokensFn<ThemeTokens, ThemeProps>, themeProps: ThemeProps, ): ThemeTokens { const defaultTokens = getTokens(themeProps); if (themeProps.appearance === 'removed') { return { ...defaultTokens, textColor: 'grey', }; } return defaultTokens; } <Badge appearance="removed" theme={themeGetterFunction}> {10} </Badge>;

    After:

    import Badge, { BadgeProps } from '@atlaskit/badge'; function getStyle(appearance: BadgeProps['appearance']) { if (appearance === 'removed') { return { color: 'grey', }; } return undefined; } const appearance = 'removed'; <Badge appearance={appearance} style={getStyle(appearance)}> {10} </Badge>;
    • [BREAKING] We have removed Container and Format components. Please use a combination of style and ReactNode type children prop for customization.

    Before:

    import { Container, Format } from '@atlaskit/badge'; <Container backgroundColor="red" textColor="blue"> <em> <Format>{10}</Format> </em> </Container>;

    After:

    import Badge from '@atlaskit/badge'; <Badge style={{ backgroundColor: 'red', color: 'blue' }}> <em> {10} </em> </Badge> // or if you are passing `max` prop so that formatting logic should work <em> <Badge style={{ backgroundColor: 'red', color: 'blue' }} max={5}> {10} </Badge> </em>
    • [BREAKING] We have removed the support of appearance prop object value. Please use style prop for customization.

    Before:

    import Badge from '@atlaskit/badge'; <Badge appearance={{ backgroundColor: 'red', textColor: 'blue' }}>{10}</Badge>;

    After:

    import Badge from '@atlaskit/badge'; <Badge style={{ backgroundColor: 'red', color: 'blue' }}>{10}</Badge>;

    Running the codemod cli

    To run the codemod: You first need to have the latest version installed

    yarn upgrade @atlaskit/badge@^15.0.0

    Once upgraded, use @atlaskit/codemod-cli via npx:

    npx @atlaskit/codemod-cli --parser babel --extensions ts,tsx,js [relativePath]

    The CLI will show a list of components and versions so select @atlaskit/badge@^15.0.0 and you will automatically be upgraded.

    What will be changed:

    • It will move backgroundColor and textColor from appearance prop (if object is passed as appearance prop value) to style prop.

    Run npx @atlaskit/codemod-cli -h for more details on usage.

    For Atlassians, refer to the documentation, (opens new window) for more details on the codemod CLI.

Minor Changes

Patch Changes

  • Updated dependencies

14.3.2

Patch Changes

14.3.1

Patch Changes

14.3.0

Minor Changes

Patch Changes

14.2.1

Patch Changes

14.2.0

Minor Changes

14.1.1

Patch Changes

14.1.0

Minor Changes

  • #7170, (opens new window) 4f9e6e2db5, (opens new window) - These packages now have defined entry points -- this means that you cannot access internal files in the packages that are not meant to be public. Sub-components in these packages have been explicitly defined, aiding tree-shaking and reducing bundle size.

14.0.7

Patch Changes

14.0.6

Patch Changes

14.0.5

Patch Changes

  • Updated dependencies

14.0.4

Patch Changes

14.0.3

Patch Changes

14.0.2

Patch Changes

14.0.1

Patch Changes

14.0.0

Major Changes

Patch Changes

  • Updated dependencies

13.1.10

Patch Changes

13.1.9

Patch Changes

  • Updated dependencies

13.1.8

Patch Changes

13.1.7

Patch Changes

13.1.6

Patch Changes

13.1.5

Patch Changes

13.1.4

Patch Changes

13.1.3

Patch Changes

13.1.2

Patch Changes

13.1.1

Patch Changes

13.1.0

Minor Changes

  • [minor]a97f1c5b5e, (opens new window):

    Adding an optional prop testId that will set the attribute value data-testid. It will help products to write better integration and end to end tests.

13.0.0

Major Changes

  • [major]6410edd029, (opens new window):

    Deprecated props, value and onValueUpdated have been removed from the Badge component. Please use the children prop instead.

12.1.0

Minor Changes

12.0.8

Patch Changes

  • [patch]097b696613, (opens new window):

    Components now depend on TS 3.6 internally, in order to fix an issue with TS resolving non-relative imports as relative imports

12.0.7

Patch Changes

12.0.6

Patch Changes

12.0.5

Patch Changes

12.0.4

Patch Changes

12.0.3

Patch Changes

12.0.2

Patch Changes

  • [patch]d0db01b410, (opens new window):

    TypeScript users of withAnalyticsEvents and withAnalyticsContext are now required to provide props as a generic type. This is so that TypeScript can correctly calculate the props and defaultProps of the returned component.

    Before:

    withAnalyticsEvents()(Button) as ComponentClass<Props>;

    After:

    withAnalyticsEvents<Props>()(Button);

12.0.1

Patch Changes

12.0.0

  • [major]7c17b35107, (opens new window):
    • Updates react and react-dom peer dependencies to react@^16.8.0 and react-dom@^16.8.0. To use this package, please ensure you use at least this version of react and react-dom.

11.0.3

11.0.2

11.0.1

11.0.0

  • [major]c95557e3ff, (opens new window):
    • Drops flow support.
    • Badge has been internally converted to TypeScript.
    • Typescript consumers will get static type safety.
    • No API or behavioural changes.

10.0.1

10.0.0

  • [major]76299208e6, (opens new window):

    • Drop ES5 from all the flow modules

    Dropping CJS support in all @atlaskit packages

    As a breaking change, all @atlaskit packages will be dropping cjs distributions and will only distribute esm. This means all distributed code will be transpiled, but will still contain import and export declarations.

    The major reason for doing this is to allow us to support multiple entry points in packages, e.g:

    import colors from `@atlaskit/theme/colors`;

    Previously this was sort of possible for consumers by doing something like:

    import colors from `@atlaskit/theme/dist/esm/colors`;

    This has a couple of issues. 1, it treats the file system as API making internal refactors harder, we have to worry about how consumers might be using things that aren't actually supposed to be used. 2. We are unable to do this internally in @atlaskit packages. This leads to lots of packages bundling all of theme, just to use a single color, especially in situations where tree shaking fails.

    To support being able to use multiple entrypoints internally, we unfortunately cannot have multiple distributions as they would need to have very different imports from of their own internal dependencies.

    ES Modules are widely supported by all modern bundlers and can be worked around in node environments.

    We may choose to revisit this solution in the future if we find any unintended condequences, but we see this as a pretty sane path forward which should lead to some major bundle size decreases, saner API's and simpler package architecture.

    Please reach out to #fabric-build (if in Atlassian) or create an issue in Design System Support, (opens new window) (for external) if you have any questions or queries about this.

9.2.2

9.2.1

  • [patch]d13242d, (opens new window):
    • Change API to experimental theming API to namespace component themes into separate contexts and make theming simpler. Update all dependant components.

9.2.0

9.1.5

9.1.4

9.1.2

9.1.1

9.1.0

9.0.4

9.0.3

9.0.2

9.0.1

9.0.0

8.1.0

8.0.3

8.0.2

8.0.1

8.0.0

7.1.3

7.1.2

7.1.0

  • [minor] Added ability to specify an object as the badge appearance. Added an Appearance export to theme so that we can use strings and objects for appearance theming." 6e89615, (opens new window)

7.0.0

6.3.1

6.3.0

6.2.2

6.2.1

6.2.0

6.1.0 (2017-08-24)

6.0.0 (2017-08-11)

5.0.0 (2017-08-11)

4.5.2 (2017-07-27)

4.5.1 (2017-07-25)

4.2.0 (2017-07-17)

4.2.0 (2017-07-17)

4.1.0 (2017-07-06)

4.0.5 (2017-05-26)

4.0.3 (2017-05-10)

4.0.2 (2017-04-27)

4.0.1 (2017-04-26)

4.0.0 (2017-04-12)

3.0.2 (2017-04-11)

3.0.1 (2017-04-10)

3.0.0 (2017-03-29)

  • feature; update badge to use new guidelines, and readme story (fe7bd5a, (opens new window))
  • breaking; remove APPEARANCE_ENUM and THEME_ENUM from exports
  • ISSUES CLOSED: AK-1534

2.0.0 (2017-03-27)

  • null refactor the badge component to use styled-components (70aa262, (opens new window))
  • breaking; badges now require peerDep styled-components
  • ISSUES CLOSED: AK-1943

1.2.3 (2017-03-23)

1.2.1 (2017-03-21)

1.1.0 (2017-03-15)

1.0.3 (2017-02-16)

1.0.2 (2017-02-10)

1.0.1 (2017-02-06)

Was this page helpful?
We use this feedback to improve our documentation.
© 2026 AtlassianTrademark, (opens new window)Privacy, (opens new window)License