-
-
Notifications
You must be signed in to change notification settings - Fork 380
Closed
Labels
component: switchChanges related to the switch component.Changes related to the switch component.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component: switchChanges related to the switch component.Changes related to the switch component.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.
Projects
Status
Recently completed