Skip to main content

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.

πŸ“– Storybook

Preview​

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​

PropTypeDefaultDescription
valuestringβ€”The enum value to display
colorMapRecord<string, MuiChipColor>β€”Maps enum values to MUI chip colour names
labelMapRecord<string, string>β€”Optional display labels (falls back to value if omitted)
size"small" | "medium""small"Chip size
sxSxProps<Theme>β€”Root element style overrides