GenericEnumChip
A coloured MUI Chip driven by an enum value and a colour mapping. Standardises the visual representation of status, category, and type fields across the app.
Previewβ
Live previewβ Open in Storybook
Importβ
import { GenericEnumChip } from "@xocialive/ui-components";
Basic usageβ
const STATUS_COLORS = {
active: "success",
inactive: "error",
pending: "warning",
} as const;
<GenericEnumChip value={user.status} colorMap={STATUS_COLORS} />;
Propsβ
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | β | The enum value to display |
colorMap | Record<string, MuiChipColor> | β | Maps enum values to MUI chip colour names |
labelMap | Record<string, string> | β | Optional display labels (falls back to value if omitted) |
size | "small" | "medium" | "small" | Chip size |
sx | SxProps<Theme> | β | Root element style overrides |