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.
| Name | Type | Default | Description |
|---|---|---|---|
source (required) | string | — | Name of the field on the record |
color | boolean | false | true colors the chip green for true and red for false; otherwise both are neutral |
chipVariant | 'text' | 'filled' | 'outlined' | 'soft' | 'soft' | MUI chip variant |
label | string | ReactElement | false | label from the schema | false 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}
- Python
- Ruby
class Product(models.Model):
is_available = models.BooleanField(default=True)
See also
- BooleanInput — the form counterpart, including the tri-state variant