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

Function App

examples/s2-next-macros/src/app/page.tsx:315–462  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

313}
314
315function App() {
316 let [isLazyLoaded, setLazyLoaded] = useState(false);
317 let [cardViewState, setCardViewState] = useState({
318 layout: 'grid',
319 loadingState: 'idle'
320 });
321 let cardViewLoadingOptions = [
322 {id: 'idle', label: 'Idle'},
323 {id: 'loading', label: 'Loading'},
324 {id: 'sorting', label: 'Sorting'},
325 {id: 'loadingMore', label: 'Loading More'},
326 {id: 'error', label: 'Error'}
327 ];
328 let cardViewLayoutOptions = [
329 {id: 'grid', label: 'Grid'},
330 {id: 'waterfall', label: 'Waterfall'}
331 ];
332 return (
333 <Provider elementType="main">
334 <Heading styles={style({font: 'heading-xl', textAlign: 'center'})} level={1}>
335 Spectrum 2 + Next.js
336 </Heading>
337 <div
338 className={style({
339 maxWidth: 288,
340 margin: 'auto'
341 })}>
342 <Divider />
343 </div>
344 <div
345 className={style({
346 display: 'flex',
347 flexDirection: 'column',
348 gap: 16,
349 alignItems: 'center'
350 })}>
351 <Section title="Buttons">
352 <ButtonGroup align="center" styles={style({maxWidth: '[100vw]'})}>
353 <Button variant="primary">Primary</Button>
354 <Button variant="secondary">
355 <Text>Secondary</Text>
356 </Button>
357 <ActionButton>
358 <Edit />
359 <Text>Action Button</Text>
360 <NotificationBadge value={2} />
361 </ActionButton>
362 <ToggleButton>Toggle Button</ToggleButton>
363 <LinkButton variant="primary" href="https://adobe.com" target="_blank">
364 Link Button
365 </LinkButton>
366 <ActionButtonGroup density="compact">
367 <ActionButton>Cut</ActionButton>
368 <ActionButton>Copy</ActionButton>
369 <ActionButton>Paste</ActionButton>
370 </ActionButtonGroup>
371 <ToggleButtonGroup density="compact" selectionMode="multiple">
372 <ToggleButton id="bold">Bold</ToggleButton>

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected