docusaurus/website/src/components/showcase/ShowcaseCheckbox/index.js
Lisa Chandra 458af077ae
feat(v2): new showcase page with tags and filters (#4515)
* docs: add ToggleTags component for showcase

* docs: add filter functionality

* docs: remove redundant variables

* docs: use react state for selectedTags

* docs: add control to tag checkbox

* docs: use useMemo for filteredUsers

* docs: change names of tags

* revert name tag changes

* polish the showcase page

* cleanup tags on the users list

* minor polish

* add querystring filtering

* typo

* Add title/arialabel to emulate tooltip

Co-authored-by: Javid <singularity.javid@gmail.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-22 17:15:28 +02:00

36 lines
751 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
function ShowcaseCheckbox({
className,
name,
label,
onChange,
checked,
...props
}) {
const id = `showcase_checkbox_id_${name};`;
return (
<div className={clsx(props.className, styles.checkboxContainer)} {...props}>
<input
type="checkbox"
id={id}
name={name}
onChange={onChange}
checked={checked}
/>
<label htmlFor={id}>{label}</label>
</div>
);
}
export default ShowcaseCheckbox;