### TopNavStart Layout Example (React) Source: https://atlassian.design/components/navigation-system/top-nav-items Demonstrates the layout for the start section of the top navigation bar, including a toggle button for the side navigation, an app switcher, and an app logo. This component is built using React and leverages the @atlaskit/navigation-system library. ```jsx import React from 'react'; import { ConfluenceIcon } from '@atlaskit/logo'; import { SideNavToggleButton } from '@atlaskit/navigation-system/layout/side-nav'; import { TopNavStart } from '@atlaskit/navigation-system/layout/top-nav'; import { AppLogo, AppSwitcher } from '@atlaskit/navigation-system/top-nav-items'; import { MockTopBar } from '../common/mock-top-bar'; export function TopNavStartLayoutExample() { return ( ); } export default TopNavStartLayoutExample; ``` -------------------------------- ### Customize Spotlight Action Button Appearance Source: https://atlassian.design/components/onboarding This example demonstrates how to change the appearance of action buttons within a Spotlight. It shows how to use 'subtle' and 'subtle-link' appearances in addition to the default. The example includes a button to trigger the spotlight. ```jsx import React, { useState } from 'react'; import Button, { IconButton } from '@atlaskit/button/new'; import SearchIcon from '@atlaskit/icon/core/search'; import { Spotlight, SpotlightManager, SpotlightTarget, SpotlightTransition, } from '@atlaskit/onboarding'; import { N0 } from '@atlaskit/theme/colors'; import { token } from '@atlaskit/tokens'; const SpotlightActionsAppearance = () => { const [isSpotlightActive, setIsSpotlightActive] = useState(false); const start = () => setIsSpotlightActive(true); const end = () => setIsSpotlightActive(false); return ( {/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}
{isSpotlightActive && ( end(), text: 'Default' }, { appearance: 'subtle', onClick: () => end(), text: 'Subtle', }, { appearance: 'subtle-link', onClick: () => end(), text: 'Subtle link', }, ]} heading="Action button appearances" key="action-button-appearances" target="action-button-appearances" targetRadius={3} targetBgColor={N0} > You can change the default action button appearance to `subtle` or `subtle-link`. )}
); }; export default SpotlightActionsAppearance; ``` -------------------------------- ### React Example with Configurable Delays for Animations Source: https://atlassian.design/components/spinner An interactive example allowing users to customize loading and spinner delays using `@atlaskit/select` components. This demonstrates how to manage and apply these delays to animations, influencing the user experience. ```jsx /** * @jsxRuntime classic * @jsx jsx */ import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; import {css, jsx} from '@compiled/react'; import Avatar from '@atlaskit/avatar'; import Button from '@atlaskit/button/new'; import { Label } from '@atlaskit/form'; import { ExitingPersistence, FadeIn } from '@atlaskit/motion'; import Select, { type ValueType } from '@atlaskit/select'; import Spinner from '@atlaskit/spinner'; import { token } from '@atlaskit/tokens'; type Delays = { spinner: number; content: number; }; const DelayContext = React.createContext({ spinner: 0, content: 0 }); type Phase = 'stopped' | 'loading' | 'ready'; const layoutStyles = css({ display: 'grid', justifyContent: 'center', gridTemplateColumns: 'repeat(auto-fit, minmax(0, 300px))', marginBlockStart: token('space.400', '32px'), }); const controlContainerStyles = css({ display: 'flex', maxWidth: 300, margin: '0 auto', gap: token('space.100', '8px'), flexDirection: 'column', }); const columnStyles = css({ display: 'flex', alignItems: 'center', flexDirection: 'column', textAlign: 'center', }); const columnInfoStyles = css({ minHeight: 70 }); const loadingContainerStyles = css({ display: 'flex', width: 200, height: 200, alignItems: 'center', justifyContent: 'center', }); const spinnerStyles = css({ position: 'absolute' }); function Harness({ children, title, description, }: { children: (phase: Phase, delays: Delays) => React.ReactElement; title: string; description: string; }) { const [phase, setPhase] = useState('stopped'); const delays: Delays = useContext(DelayContext); useEffect( function onPhaseChange() { if (phase === 'loading') { const id = window.setTimeout(() => setPhase('ready'), delays.content); return () => window.clearTimeout(id); } }, [delays.content, phase], ); return (

{title}

{description}

{children(phase, delays)}
); } type Option = { value: string; label: string }; const contentDelayOptions: Option[] = [ { value: '10', label: 'Content load time: tiny (10ms)' }, { value: '50', label: 'Content load time: small (50ms)' }, { value: '100', label: 'Content load time: medium (100ms)' }, { value: '500', label: 'Content load time: long (500ms)' }, { value: '2000', label: 'Content load time: super long (2000ms)' }, ]; const defaultContentDelay: Option = contentDelayOptions[1]; const spinnerDelayOptions: Option[] = [ { value: '0', label: 'Spinner delay: none (default)' }, { value: '100', label: 'Spinner delay: too short (100ms)' }, { value: '500', label: 'Spinner delay: medium (500ms)' }, { value: '1000', label: 'Spinner delay: long (1000ms)' }, ]; const defaultSpinnerDelay: Option = spinnerDelayOptions[0]; function Example() { const [contentDelay, setContentDelay] = useState(Number(defaultContentDelay.value)); const onContentDelayChange = useCallback((result: ValueType