스포트라이트
스포트라이트 (Spotlight)
스포트라이트는 사용자를 특정 기능, 온보딩 투어, 또는 UI 하이라이트로 안내하는 오버레이 컴포넌트예요. SpotlightActions, SpotlightBody, SpotlightCard처럼 서로 역할이 다른 여러 하위 컴포넌트로 구성돼요.
출처: 문서
본문
SpotlightActions 컴포넌트
스포트라이트 푸터에 배치하는 액션 버튼 또는 링크들의 컨테이너예요.
- Keywords: spotlight, actions, footer, buttons
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Elements to be rendered inside the SpotlightActions |
사용 지침
- 기본/보조 액션 버튼이나 링크를 담는 컨테이너예요
SpotlightBody 컴포넌트
스포트라이트 카드의 메인 콘텐츠 영역이에요.
- Keywords: spotlight, body, content
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Textual content is required for all spotlights (required) |
SpotlightCard 컴포넌트
스포트라이트는 집중된 메시지부터 다단계 투어까지, 사용자에게 관심 지점을 소개해요.
- Keywords: spotlight, onboarding, tour, feature, discovery, card
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Elements to be rendered inside the SpotlightCard |
placement |
"top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | "top-center" | "bottom-center" |
The position in relation to the target the content should be shown at |
사용 지침
- 온보딩, 기능 발견, UI 하이라이트에 사용해요
- 가능하면 콘텐츠는 한 단계로 유지하고, 투어는 최대 세 단계로 해요
- 항상 첫 번째 포커스 요소로 닫기 컨트롤을 포함해요
- 필요에 따라 버튼이나 링크에 기본/보조 액션을 활용해요
접근성 지침
- 닫기 컨트롤이 첫 번째 포커스 요소가 되어야 해요
- 스포트라이트 콘텐츠가 몇 초 안에 이해되도록 해요
SpotlightDismissControl 컴포넌트
스포트라이트 카드에 필수인 닫기/해제 버튼이에요. 첫 번째 포커스 요소가 되어야 해요.
- Keywords: spotlight, dismiss, close, control
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
autoFocus |
boolean |
Specifies whether the dismiss button should be focused when the spotlight is rendered |
onClick |
(e: MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, analyticsEvent: UIAnalyticsEvent) => void |
The action to take when the button is clicked |
사용 지침
- 모든 스포트라이트에 필수예요. 접근성을 위해 첫 번째 포커스 요소가 되어야 해요
접근성 지침
- 올바른 포커스 순서를 위해 첫 번째 포커스 요소가 되어야 해요
SpotlightFooter 컴포넌트
스포트라이트 카드의 푸터 영역이에요. 액션 버튼 또는 링크를 담아요.
- Keywords: spotlight, footer, actions
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Elements to be rendered inside the SpotlightFooter |
사용 지침
- 기본/보조 액션 버튼 또는 링크를 담아요
SpotlightHeader 컴포넌트
스포트라이트 카드의 헤더 영역이에요. 헤드라인과 컨트롤을 담아요.
- Keywords: spotlight, header
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
Elements to be rendered inside the SpotlightHeader |
사용 지침
- 헤드라인과 닫기/컨트롤 영역을 담아요
SpotlightHeadline 컴포넌트
스포트라이트 카드의 헤드라인/제목이에요. SpotlightHeader 안에서 사용해요.
- Keywords: spotlight, headline, title
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal |
A brief and direct title to clearly communicate the intent (required) |
사용 지침
- 헤드라인을 간결하게 하고 몇 초 안에 이해되도록 해요
PopoverContent 컴포넌트
스포트라이트 카드 콘텐츠를 렌더링해요. PopoverProvider와 PopoverTarget과 함께 사용해요.
- Keywords: spotlight, popover, content, positioning
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
back |
(event: BackEvent) => void |
Invoked when the user clicks SpotlightSecondaryAction |
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
The content to be rendered in PopoverContent (required) |
dismiss |
(event: DismissEvent) => void |
Spotlights can be dismissed by: |
- Clicking the
SpotlightDismissControl - Clicking any DOM element outside the spotlight (if
shouldDismissOnClickOutside === true) - Pressing the Escape key
These events align to the React (required) |
| done | (event: DoneEvent) => void | Invoked when the user clicks SpotlightPrimaryAction |
| isVisible | boolean | Controls whether or not PopoverContent is visible |
| motion | React.ComponentClass<{ children: React.ReactNode; }, any> \| React.FunctionComponent<{ children: React.ReactNode; }> | The motion to be applied to the SpotlightCard |
| next | (event: NextEvent) => void | Invoked when the user clicks SpotlightPrimaryAction in a tour |
| offset | [number, number] | Distance the spotlight should be offset from the target in the format of [along, away] (units in px) |
| placement | "top-start" \| "top-end" \| "bottom-start" \| "bottom-end" \| "right-start" \| "right-end" \| "left-start" \| "left-end" \| "top-center" \| "bottom-center" | The position in relation to the target the content should be shown at (required) |
| shouldDismissOnClickOutside | boolean | Controls whether the 'dismiss' action is invoked when the user clicks outside the content |
사용 지침
- Placement는 고정이에요. 넘침(overflow)을 방지하는 배치를 선택해요
PopoverProvider 컴포넌트
스포트라이트 콘텐츠의 위치를 잡기 위한 컨텍스트 프로바이더예요. PopoverTarget와 PopoverContent로 감싸요.
- Keywords: spotlight, popover, provider, positioning
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
The to be rendered in PopoverProvider (required) |
사용 지침
- 위치 지정을 위해 타겟 요소와 스포트라이트 콘텐츠를 감싸요
PopoverTarget 컴포넌트
스포트라이트의 위치 기준이 되는 요소예요. PopoverProvider와 PopoverContent과 함께 사용해요.
- Keywords: spotlight, popover, target, positioning
- Categories: navigation
- Status: open-beta
예시
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { cssMap, jsx } from '@atlaskit/css';
import { Flex } from '@atlaskit/primitives/compiled/flex';
import { Text } from '@atlaskit/primitives/compiled/text';
import { SpotlightActions } from '@atlaskit/spotlight/actions';
import { SpotlightBody } from '@atlaskit/spotlight/body';
import { SpotlightCard } from '@atlaskit/spotlight/card';
import { SpotlightControls } from '@atlaskit/spotlight/controls';
import { SpotlightDismissControl } from '@atlaskit/spotlight/dismiss-control';
import { SpotlightFooter } from '@atlaskit/spotlight/footer';
import { SpotlightHeader } from '@atlaskit/spotlight/header';
import { SpotlightHeadline } from '@atlaskit/spotlight/headline';
import { PopoverContent } from '@atlaskit/spotlight/popover-content';
import { PopoverProvider } from '@atlaskit/spotlight/popover-provider';
import { PopoverTarget } from '@atlaskit/spotlight/popover-target';
import { SpotlightPrimaryAction } from '@atlaskit/spotlight/primary-action';
import { SpotlightSecondaryLink } from '@atlaskit/spotlight/secondary-link';
import { token } from '@atlaskit/tokens';
const styles = cssMap({
target: {
paddingBlockStart: token('space.100'),
paddingInlineEnd: token('space.100'),
paddingBlockEnd: token('space.100'),
paddingInlineStart: token('space.100'),
borderStyle: 'solid',
borderWidth: token('border.width'),
borderColor: token('color.border.bold'),
},
});
export default (): JSX.Element => (
<Flex>
<PopoverProvider>
<PopoverTarget>
<div css={styles.target}>
<Text>Target</Text>
</div>
</PopoverTarget>
<PopoverContent isVisible={true} placement="right-end" dismiss={() => {}}>
<SpotlightCard>
<SpotlightHeader>
<SpotlightHeadline>Try the new experience</SpotlightHeadline>
<SpotlightControls>
<SpotlightDismissControl />
</SpotlightControls>
</SpotlightHeader>
<SpotlightBody>
<Text>
When your primary or secondary control should navigate to a URL instead of performing
an action, use SpotlightPrimaryLink and SpotlightSecondaryLink.
</Text>
</SpotlightBody>
<SpotlightFooter>
<SpotlightActions>
<SpotlightSecondaryLink
href="https://atlassian.design/components/spotlight"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</SpotlightSecondaryLink>
<SpotlightPrimaryAction>Done</SpotlightPrimaryAction>
</SpotlightActions>
</SpotlightFooter>
</SpotlightCard>
</PopoverContent>
</PopoverProvider>
</Flex>
);
Props
| Prop | Type | Description |
|---|---|---|
children |
string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
The content to be rendered in PopoverTarget (required) |
사용 지침
- 스포트라이트가 가리키는 UI 요소를 감싸요