Skip to content

BooleanProp

Boolean property definition for props a consumer sets on or off, typically read from a Figma boolean property that toggles a layer.

Path

component-api:props.<prop>

Members

MemberTypeRequiredDescription
type'boolean'YesThe discriminator — always 'boolean'.
defaultbooleanYesThe value a consumer gets without setting the prop.
$extensionsPropExtensionsNoPlatform provenance under reverse-domain keys.

Example

type: boolean
default: false

States

A boolean prop named by a specs.states entry is a state concept, not an ordinary parameter. Whether it stays in the emitted contract follows the concept’s disposition — browser-managed concepts (hover, focus, active) leave the contract entirely, consumer-set ones (disabled, selected, invalid) stay and also surface as an aria attribute. The rule’s case table is the statesToContract rule, shared by both emitters and the CSS transform.

Platform bindings

Figma

Disposition: bound · Realised by: ComponentPropertyDefinitions (BOOLEAN, or a two-option VARIANT)

Rules: variantAxes — with enum, number · booleanContentPairing

A native BOOLEAN property reads directly. A VARIANT whose options are exactly true/false (case-insensitive) also reads as a boolean, recording $extensions['com.figma'].type: VARIANT so the render direction rebuilds the variant axis rather than a BOOLEAN property. Render creates a BOOLEAN property where the prop is bound to an element’s visible.

CSS

Disposition: bound · Realised by: Css, states

Rules: propsToSelectors — with enum, number, object

A boolean prop is a selection fact, not a declaration: a variant configuration naming it becomes an attribute selector on the emitting platform’s surface. A boolean classified as a state concept selects by the concept’s selector instead (pseudo-class or aria attribute).

React

Disposition: bound · Realised by: a boolean member of the component’s Props interface

Rules: statesToContract — with enum

Declared in the generated types file with its default in the Defaults export. In JSX a true value spells as the bare attribute, false as {false}. A boolean classified as a browser-managed state concept never reaches the contract.

Web Components

Disposition: bound · Realised by: a boolean member of the element’s contract, reflected as an attribute

Rules: statesToContract — with enum

The contract types and defaults are the shared platform-neutral derivation — the same module React uses. Reflection follows the shared attribute rule: the bare attribute where the name is free, the data- form where it collides with a global attribute that already has behaviour.

Decisions

  • ADR-015 — Resolve AnyProp oneOf schema violation between TextProp and IconProp
  • ADR-105 — Type–Schema Parity for Overlapping Prop Unions
  • ADR-125 — Instance-example orientation

Source

FormatFile
JSON Schemapackages/schema/schema/component.schema.json
TypeScriptpackages/schema/types/Props.ts
Specification§4.2, §11