CodeLeap Docs

CommonWebMobileCLIConceptsUpdates

Badge

Component

The Badge component is used to display a numerical value or count on the screen. It is often used to show notifications or counts associated with specific items or features. The user can interact with the Badge component by clicking on it or hovering over it to reveal additional information or trigger an action.

Source

View source code

Package

@codeleap/web

Props

  • debugName (optional: string): A debug name that can be used to identify the component during development or debugging.
  • disabled (optional: boolean): If set to true, the Badge component will be disabled and user interaction will be prevented.
  • maxCount (optional: number): The maximum count or value that the Badge component can display. If the value exceeds this maximum, it will be truncated to the specified maximum count.
  • minCount (optional: number): The minimum count or value that the Badge component can display. If the value is less than this minimum, it will be truncated to the specified minimum count.

Example Usage

import { Badge } from "@codeleap/web";
function App() {
return (
<div>
<Badge debugName="notification-badge" maxCount={99} minCount={0}>
10
</Badge>
</div>
);
}

Table of contents

Props