Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Checkbox] Implement Checkbox with new API #24

Closed
michaldudak opened this issue Jul 19, 2023 · 2 comments · Fixed by #159
Closed

[Checkbox] Implement Checkbox with new API #24

michaldudak opened this issue Jul 19, 2023 · 2 comments · Fixed by #159
Assignees
Labels
component: checkbox This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@michaldudak
Copy link
Member

michaldudak commented Jul 19, 2023

This is the place to gather ideas, measure interest and discuss the API and implementation details of the checkbox component and hook.

See #10 for the umbrella issue to track progress on Base UI and mui/material-ui#6218 for the problem this project solve.

@michaldudak michaldudak changed the title Checkbox ⭐ [Checkbox][base] Create the unstyled component and hook Jul 19, 2023
@michaldudak michaldudak changed the title [Checkbox][base] Create the unstyled component and hook [Checkbox][base-ui] Create the unstyled component and hook Aug 18, 2023
@DiegoAndai
Copy link
Member

Whenever we tackle this issue, we should keep in mind this Material UI issue about indeterminate/mixed state: mui/material-ui#20476

@michaldudak michaldudak transferred this issue from mui/material-ui Feb 27, 2024
@michaldudak michaldudak changed the title [Checkbox][base-ui] Create the unstyled component and hook [Checkbox] Create the unstyled component and hook Feb 27, 2024
@michaldudak michaldudak added new feature New feature or request component: checkbox This is the name of the generic UI component, not the React module! labels Feb 27, 2024
@colmtuite colmtuite changed the title [Checkbox] Create the unstyled component and hook [Checkbox] Implement Checkbox with new API Mar 5, 2024
@colmtuite
Copy link
Contributor

Anatomy

// JSX
<Checkbox>
	<Checkbox.Indicator />
</Checkbox>

// Rendered HTML
<button type="button" role="checkbox" aria-checked="false" value="off" data-state="unchecked">
	<span data-state="unchecked" />
</button>
<input type="checkbox" aria-hidden="true" tabindex="-1" style="hide visually" />

Components

Root

Rendered element: button

prop type default description
required boolean false
disabled boolean false
autoFocus boolean false
readOnly boolean false
name string
checked boolean
defaultChecked boolean
onChange (event: ChangeEvent) ⇒ void
render (props, state) ⇒ ReactElement
className

Indicator

Rendered element: span

Design Notes

  • [data-state] [data-readonly] and [data-disabled] should go on both component parts, when applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: checkbox This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants