Skip to content

[Bug]: Checkbox component name prop requirements #346

@AregSoft

Description

@AregSoft

Component

Checkbox

Is this a regression?

None

Describe the bug

The Checkbox component currently enforces the name prop as a required property. While the name attribute is necessary for form submission and accessibility when the component is part of a native HTML <form>, it is not required when the Checkbox is used for state management within a controlled React environment or for display purposes outside of a form context.

To Reproduce

  1. Render a standalone Checkbox component in a React application without passing the name prop
    <Checkbox checked={isChecked} onChange={handleChange} />
  2. The component throws a runtime error or a PropTypes/TypeScript error indicating that the required name prop is missing.

Expected behavior

The name prop should be changed from required to optional in the component's interface.

Screenshots

No response

Package version

v3.0.0

Desktop

. OS:
. Browser & version:
. Additional Information:

Smartphone

. Device:
. OS:
. Browser & version:
. Additional Information:

Exception or Error

Additional context

No response

Metadata

Metadata

Assignees

Labels

phase / ready-to-goThis issue merged and will be included in the current milestone releasetype / bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions