MCPcopy Create free account
hub / github.com/adobe/react-spectrum / TableCheckboxCell

Function TableCheckboxCell

packages/react-aria/stories/table/example.tsx:210–223  ·  view source on GitHub ↗
({cell, state}: {cell: any; state: any})

Source from the content-addressed store, hash-verified

208}
209
210export function TableCheckboxCell({cell, state}: {cell: any; state: any}): JSX.Element {
211 let ref = useRef<HTMLTableCellElement | null>(null);
212 let {gridCellProps} = useTableCell({node: cell}, state, ref);
213 let {checkboxProps} = useTableSelectionCheckbox({key: cell.parentKey}, state);
214
215 let inputRef = useRef(null);
216 let {inputProps} = useCheckbox(checkboxProps, useToggleState(checkboxProps), inputRef);
217
218 return (
219 <td {...gridCellProps} ref={ref}>
220 <input {...inputProps} />
221 </td>
222 );
223}
224
225export function TableSelectAllCell({column, state}: {column: any; state: any}): JSX.Element {
226 let ref = useRef<HTMLTableCellElement | null>(null);

Callers

nothing calls this directly

Calls 4

useTableCellFunction · 0.90
useCheckboxFunction · 0.90
useToggleStateFunction · 0.90

Tested by

no test coverage detected