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

[Switch] Implement new API #4

Closed
Tracked by #211 ...
colmtuite opened this issue Feb 16, 2024 · 0 comments · Fixed by #135
Closed
Tracked by #211 ...

[Switch] Implement new API #4

colmtuite opened this issue Feb 16, 2024 · 0 comments · Fixed by #135
Assignees
Labels
component: switch This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature

Comments

@colmtuite
Copy link
Contributor

colmtuite commented Feb 16, 2024

Anatomy

// JSX
<Switch required>
  <Switch.Thumb />
</Switch>

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

Components

Root

Rendered element: button

prop type default
required boolean false
disabled boolean false
autoFocus boolean false
readOnly boolean false
name string
checked boolean
defaultChecked boolean
onChange (event: ChangeEvent) ⇒ void

Thumb

Rendered element: span

prop type type
render (props, state) ⇒ ReactElement
className

State Object

  • required
  • disabled
  • readOnly
  • checked
@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 16, 2024
@colmtuite colmtuite removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 16, 2024
@michaldudak michaldudak transferred this issue from mui/material-ui Feb 26, 2024
@michaldudak michaldudak changed the title [base-ui][Switch] Implement new API [Switch] Implement new API Feb 27, 2024
@michaldudak michaldudak added component: switch This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature labels Feb 27, 2024
@colmtuite colmtuite moved this from Backlog to In progress in Base UI Alpha Mar 21, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Base UI Alpha Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: switch This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants