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

Function Rows

packages/dev/s2-docs/src/PropTable.tsx:256–326  ·  view source on GitHub ↗
({
  props,
  showDefault,
  showRequired
}: {
  props: TInterface['properties'];
  showDefault?: boolean;
  showRequired?: boolean;
})

Source from the content-addressed store, hash-verified

254}
255
256function Rows({
257 props,
258 showDefault,
259 showRequired
260}: {
261 props: TInterface['properties'];
262 showDefault?: boolean;
263 showRequired?: boolean;
264}) {
265 let properties = Object.values(props);
266
267 return properties.map((prop, index) => (
268 <React.Fragment key={index}>
269 <TableRow>
270 <TableCell
271 role="rowheader"
272 hideBorder={!!prop.description}
273 styles={style({whiteSpace: 'nowrap'})}>
274 <code className={codeStyle}>
275 <span className={codeStyles.attribute}>{prop.name}</span>
276 </code>
277 {!prop.optional && showRequired ? (
278 <Asterisk
279 size="M"
280 className={style({
281 marginStart: 4,
282 '--iconPrimary': {
283 type: 'fill',
284 value: 'currentColor'
285 }
286 })}
287 aria-label="Required"
288 />
289 ) : null}
290 </TableCell>
291 <TableCell hideBorder={!!prop.description}>
292 <code className={codeStyle}>
293 <Type type={prop.value} />
294 </code>
295 </TableCell>
296 {showDefault && (
297 <TableCell
298 hideBorder={!!prop.description}
299 styles={
300 prop.default
301 ? undefined
302 : style({display: {default: 'none', sm: '[table-cell]'}, whiteSpace: 'nowrap'})
303 }>
304 <strong className={style({font: 'ui', fontWeight: 'bold', display: {sm: 'none'}})}>
305 Default:{' '}
306 </strong>
307 {prop.default ? (
308 <span className={codeStyle}>
309 <Code lang="tsx">{prop.default}</Code>
310 </span>
311 ) : (
312 '—'
313 )}

Callers

nothing calls this directly

Calls 1

renderHTMLfromMarkdownFunction · 0.90

Tested by

no test coverage detected