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

Mark SwitchGroup as deprecated, prefer Field instead #3232

Merged
merged 2 commits into from
May 23, 2024

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented May 22, 2024

This PR marks the SwitchGroup component as deprecated in favor of the new <Field> component.

The SwitchGroup component was useful if you wanted to link a <Switch> and a <Switch.Label> together. However, now we have more generic components that allows you to do this instead and is more consistent with all other components as well.

E.g.:

<Switch.Group>
 <Switch.Label>Label</Switch.Label>
 <Switch />
</Switch.Group>

↓↓↓↓

<SwitchGroup>
 <SwitchLabel>Label</SwitchLabel>
 <Switch />
</SwitchGroup>

↓↓↓↓

<Field>
 <Label>Label</Label>
 <Switch />
</Field>

This Field and Label component combination can also be used with other components like Checkbox, Combobox, Input, Listbox, Radio, Select, and Textarea.

Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 9:11pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 9:11pm

Also updated the `Switch.Group` message to also prefer the `<Field>`
component.
@RobinMalfait RobinMalfait merged commit b478189 into main May 23, 2024
8 checks passed
@RobinMalfait RobinMalfait deleted the feat/mark-switchgroup-deprecated branch May 23, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants