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

Function App

examples/s2-vite-project/src/App.tsx:310–451  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected