Skip to content

[Switch] Implement new API #4

Closed

Description

@colmtuite

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

Activity

  1. added
    status: waiting for maintainer
    on Feb 16, 2024
  2. removed
    status: waiting for maintainer
    on Feb 16, 2024
  3. changed the title [-][base-ui][Switch] Implement new API[/-] [+][Switch] Implement new API[/+] on Feb 27, 2024
  4. added
    component: switch
    type: enhancement
    on Feb 27, 2024
  5. moved this from Backlog to In progress in Base UI public roadmapon Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component: switchtype: enhancement

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions