The p-segmented-control can be integrated into a form in two ways: controlled or uncontrolled, depending on
your needs.
In the controlled approach, the p-segmented-control state is externally managed using the value property and
change event to keep it in sync with your application logic. This approach is ideal for complex forms or when using a
form library. Note that the component will still always update its internal value automatically when interacted with.
In the uncontrolled approach, the p-segmented-control automatically managing its own state and including its value
in form submissions through the ElementInternals
API. This is convenient for smaller forms or simple submissions.
Attention
The p-segmented-control lacks access to native ValidityState
properties and validationMessage, and it cannot display the native validation popover. This means
validation behavior and error display will need to be implemented separately if required.
For more details on form integration, refer to the Form section in the
developing documentation for your framework of choice, or find a full form integration
example in our examples repository.