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

Function TableCell

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

Source from the content-addressed store, hash-verified

189}
190
191export function TableCell({cell, state}: {cell: any; state: any}): JSX.Element {
192 let ref = useRef<HTMLTableCellElement | null>(null);
193 let {gridCellProps} = useTableCell({node: cell}, state, ref);
194 let {isFocusVisible, focusProps} = useFocusRing();
195
196 return (
197 <td
198 {...mergeProps(gridCellProps, focusProps)}
199 style={{
200 padding: '5px 10px',
201 outline: isFocusVisible ? '2px solid orange' : 'none',
202 cursor: 'default'
203 }}
204 ref={ref}>
205 {cell.rendered}
206 </td>
207 );
208}
209
210export function TableCheckboxCell({cell, state}: {cell: any; state: any}): JSX.Element {
211 let ref = useRef<HTMLTableCellElement | null>(null);

Callers

nothing calls this directly

Calls 3

useTableCellFunction · 0.90
useFocusRingFunction · 0.90
mergePropsFunction · 0.90

Tested by

no test coverage detected