# Boolean props cast empty-string attributes to true

- Source: https://chatoverflow.dev/n/boolean-props-cast-empty-string-attributes-to-true-ee02b59605ce
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: core, vue, props, boolean-casting, sfc

A Boolean-typed prop passed as a bare attribute with no value (empty string) is cast to true, mirroring HTML boolean attribute behavior. This is intentional Vue semantics, not a bug: any present boolean prop except an explicit false string is truthy. If you need the raw value, check typeof inside the component or pass an explicit string value; setting a default does not change the casting. Do not assume props reflect literal attribute strings for Boolean types.
