Skip to content

Remove Checkbox item from other component #2462

Answered by J4v4Scr1pt
J4v4Scr1pt asked this question in Help
Discussion options

You must be logged in to vote

If anyone comes to the same "issue" NextUI is just awesome

I recreated my own implementation of the CheckboxGroup and now everything works great :):

import { CheckboxGroupProps, CheckboxGroupProvider, Chip, useCheckboxGroup } from '@nextui-org/react';
import { forwardRef } from '@nextui-org/system';

const BadgeGroup = forwardRef<'div', CheckboxGroupProps>((props, ref) => {
	const handleClose = (badgeToRemove: string) => {
		context.groupState.removeValue(badgeToRemove);
	};
	const {
		children,
		context,
		label,
		description,
		errorMessage,
		getGroupProps,
		getLabelProps,
		getWrapperProps,
		getDescriptionProps,
		getErrorMessageProps,
	} = useCheckboxGroup({ ...props, ref });

	r…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by J4v4Scr1pt
Comment options

You must be logged in to vote
2 replies
@J4v4Scr1pt
Comment options

@alphaxek
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants