Skip to main content

Badge

The Badge cell displays one of the following badge.

OK
OK
42
+999
KO

Badge Status

OK

One of the main purpose of this typeCell is to display a menu based on the current value.

SwitchBagde

The SwitchBadge cell allows to handle advanced needs, like 3 dimensionnals datas.

Example

In this example, we will display the grades of students during the year and for multiple subject.

Winter
Spring
Summer
<CodePreview
content={SwitchBadgeGradeExampleSource}
/>
tip

This could be achieve without using SwithBadge by using a dynamic data object. But the advantage of SwitchBadge is to only update the config props. This can be very useful with a large amount of data.

Props

NameTypeRequiredDefaultDescription
actionsByStatusarrayNo[]Array of actionByStatus passed to ContextMenu component
switchKeystringYesWarning: Only working with switch_badge_status typeCell.

actionByStatus

NameTypeRequiredDefaultDescription
actionfuncYesCallback fired when the choice is selected
labelanyYesElement passed as a children to MenuItem
statusarrayYesArray of status that allows this choice