primefaces/primeng

ToggleButton does not allow `undefined` as size

Open

#19591 opened on May 21, 2026

View on GitHub
 (0 comments) (0 reactions) (0 assignees)CSS (10,366 stars) (4,585 forks)batch import
Type: Buggood first issue

Description

Describe the bug

Most components that have a [size] input allow it to be undefined, which would be the normal size. However, the ToggleButton only allows "small" or "large" as values but not undefined. (https://primeng.org/togglebutton#api.togglebutton.props.size). Note that using null does also not work.
This makes it hard to set it programatically.

Pull Request Link

https://github.com/primefaces/primeng/pull/19592

Reproducer

https://primeng.org/togglebutton#api.togglebutton.props.size

Environment

PrimeNG 21, Angular 21

Angular version

21.0.0

PrimeNG version

v21

Browser(s)

Firefox, CHrome

Steps to reproduce the behavior

  1. Create a <p-togglebutton> component and try to set the [size]="undefined". It will give a build error.

Expected behavior

ToggleButton should also allow undefined as size like other components (e.g., AutoComplete, Select, InputText, etc.)

Contributor guide