Skip to main content

BooleanField

Displays a boolean as a yes/no chip.

The chip label comes from the translation catalogue (ra.message.yes / ra.message.no), so it follows the admin locale.

Example​

<BooleanField source="is_available" color />

Props​

The component wraps React Admin's BooleanField, driving its TrueIcon / FalseIcon with a chip of its own. On top of these it accepts the shared field props.

NameTypeDefaultDescription
source (required)string—Name of the field on the record
colorbooleanfalsetrue colors the chip green for true and red for false; otherwise both are neutral
chipVariant'text' | 'filled' | 'outlined' | 'soft''soft'MUI chip variant
labelstring | ReactElement | falselabel from the schemafalse hides the label

The chip labels are the ra.message.yes / ra.message.no translations of the active locale — they are not props.

caution

color is a boolean here, not an MUI color name — passing "success" enables coloring but does not select a palette entry.

Schema mapping​

Any field with type: "boolean", regardless of format:

{"name": "is_available", "type": "boolean", "defaultValue": true}
class Product(models.Model):
is_available = models.BooleanField(default=True)

See also​

  • BooleanInput — the form counterpart, including the tri-state variant