본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

태그

원문 보기 위키 갱신

태그 (Tag)

태그는 콘텐츠를 분류하고 구성하는 데 쓰는 컴포넌트예요. 사람·에이전트·팀·프로젝트를 나타내는 아바타 태그, 제거 가능한 라벨, 정적인 태그까지 상황에 맞춰 다양하게 활용할 수 있어요.

출처: 문서

본문

AvatarTag 컴포넌트

아바타 태그는 사람, 에이전트, 팀, 프로젝트 또는 공간을 나타내어 태깅, 빠른 인식, 탐색을 돕는 라벨이에요.

  • Keywords: tag, avatar, user, agent, team, project, space
  • Categories: data-display
  • Status: open-beta

예시

import Avatar from '@atlaskit/avatar/avatar';
import AvatarTag from '@atlaskit/tag/avatar-tag';
const avatarUrl = 'https://pbs.twimg.com/profile_images/803832195970433027/aaoG6PJI_400x400.jpg';
export default (): React.JSX.Element => (
	<AvatarTag
		type="user"
		text="Brian Lin"
		avatar={(props: any) => <Avatar {...props} src={avatarUrl} name="Brian Lin" />}
	/>
);

Props

Prop Type Description
avatar ComponentType<AvatarPropTypes> | ComponentType<TeamAvatarProps> The avatar component to render (required)
hasMargin boolean When false, removes the tag's default margin
href string URI or path
isRemovable boolean Flag to indicate if a tag is removable
isVerified boolean isVerified is not allowed for user tags
linkComponent ComponentClass<any, any> | FunctionComponent<any> A link component to be used instead of our standard link
maxWidth string | number Maximum width of the tag
onAfterRemoveAction (text: string) => void Handler to be called after tag is removed
onBeforeRemoveAction () => boolean Handler to be called before the tag is removed
onClick (e: MouseEvent<HTMLAnchorElement, globalThis.MouseEvent>, analyticsEvent: UIAnalyticsEvent) => void Handler called when the tag is clicked
removeButtonLabel string Text rendered as the aria-label for remove button
text string Text to be displayed in the tag (usually a person's name or entity name) (required)
type "other" | "user" | "agent" The type of avatar tag (required)

사용 지침

  • 사람(user), 에이전트(agent), 또는 팀·프로젝트·공간(other)을 나타낼 때 사용해요
  • isVerified는 검증된 팀에만 사용해요
  • 절제해서 사용해요—아바타 태그는 인지적 노이즈를 더해요
  • 일반 객체 범주에는 사용하지 말고 Tag를 사용해요
  • 사용자 생성 텍스트(예: 에디터) 안에서는 사용하지 마세요
  • 레이아웃을 제어하려면 TagGroup을 사용해요

콘텐츠 지침

  • 이름이 최대 너비를 넘으면 생략 부호(ellipsis)로 줄여요
  • 잘린 텍스트에는 호버 시 툴팁을 제공해요
  • 명확하고 설명적인 이름을 사용해요

접근성 지침

  • 아바타 표현에 의미 있는 이름을 제공해요
  • 아바타 모양이 유형을 전달하도록 해요(원형=user, 육각형=agent, 사각형=other)

RemovableTag 컴포넌트

태그는 UI 객체에 라벨을 붙여 빠른 인식과 탐색을 돕는 컴포넌트예요.

  • Keywords: tag, removable, chip, label, category, close
  • Categories: data-display
  • Status: open-beta

예시

import Tag from '@atlaskit/tag/removable-tag';
export default (): React.JSX.Element => <Tag text="Design" isRemovable={false} />;

Props

Prop Type Description
appearance "default" | "rounded" Set whether tags are rounded
color "blue" | "gray" | "green" | "grey" | "lime" | "magenta" | "orange" | "purple" | "red" | "teal" | "yellow" | "standard" | "limeLight" | "orangeLight" | "magentaLight" | "greenLight" | ... 5 more ... | "yellowLight" The color theme to apply
elemBefore string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal The component to be rendered before the tag
hasMargin boolean When false, removes the tag's default margin
href string URI or path
isRemovable boolean Flag to indicate if a tag is removable
linkComponent ComponentClass<any, any> | FunctionComponent<any> A link component to be used instead of our standard anchor
maxWidth string | number Maximum width of the tag text
onAfterRemoveAction (text: string) => void Handler to be called after tag is removed
onBeforeRemoveAction () => boolean Handler to be called before the tag is removed
removeButtonLabel string Text rendered as the aria-label for remove button
swatchBeforeLabel string Accessible label for the tag's leading color swatch
swatchBeforeRole "grid" | "article" | "button" | "dialog" | "figure" | "form" | "img" | "link" | "main" | "menu" | "menuitem" | "option" | "search" | "table" | "switch" | "listbox" | "tree" | "status" | ... 51 more ... | "treeitem" The WAI-ARIA role applied to the tag's color swatch element
text string | string[] Text to be displayed in the tag (required)

사용 지침

  • 제거 기능과 함께 콘텐츠를 분류하거나 라벨링할 때 사용해요
  • 객체와 관련된 콘텐츠에 사용해요; 사람/팀/프로젝트에는 AvatarTag를 사용해요
  • 상태 표시에는 사용하지 말고 lozenge를 사용해요
  • 여러 태그의 레이아웃을 제어하려면 TagGroup을 사용해요
  • 사용자 생성 텍스트 안에서는 태그를 사용하지 마세요

콘텐츠 지침

  • 명확하고 설명적인 태그 라벨을 사용해요
  • 태그 텍스트를 간결하게 유지해요; 최대 200px을 넘으면 잘려요
  • 관련 콘텐츠를 구성하려는 의도로 색상을 사용해요
  • 사람, 팀, 공간, 프로젝트에는 아바타 태그를 사용해요

Tag 컴포넌트

태그는 콘텐츠를 분류하고 구성하는 데 쓰는 미묘하고 컴팩트한 라벨이에요.

  • Keywords: tag, label, category, filter, chip, badge
  • Categories: data-display
  • Status: general-availability

예시

import Tag from '@atlaskit/tag/removable-tag';
const Examples = (): React.JSX.Element => (
	<>
		<Tag text="Basic tag" />
		<Tag text="Bug" color="red" />
		<Tag text="Removable tag" removeButtonLabel="Remove" />
	</>
);
export default Examples;

Props

Prop Type Description
appearance "default" | "rounded" Set whether tags are rounded
color "blue" | "gray" | "green" | "grey" | "lime" | "magenta" | "orange" | "purple" | "red" | "teal" | "yellow" | "standard" | "limeLight" | "orangeLight" | "magentaLight" | "greenLight" | ... 5 more ... | "yellowLight" The color theme to apply
elemBefore string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal The component to be rendered before the tag
hasMargin boolean When false, removes the tag's default margin
href string URI or path
isRemovable boolean Flag to indicate if a tag is removable
linkComponent ComponentClass<any, any> | FunctionComponent<any> A link component to be used instead of our standard anchor
maxWidth string | number Maximum width of the tag text
onAfterRemoveAction (text: string) => void Handler to be called after tag is removed
onBeforeRemoveAction () => boolean Handler to be called before the tag is removed
removeButtonLabel string Text rendered as the aria-label for remove button
swatchBeforeLabel string Accessible label for the tag's leading color swatch
swatchBeforeRole "grid" | "article" | "button" | "dialog" | "figure" | "form" | "img" | "link" | "main" | "menu" | "menuitem" | "option" | "search" | "table" | "switch" | "listbox" | "tree" | "status" | ... 51 more ... | "treeitem" The WAI-ARIA role applied to the tag's color swatch element
text string | string[] Text to be displayed in the tag (required)

사용 지침

  • 분류, 속성, 주제, 그룹 같은 설명적이거나 맥락적인 메타데이터에 사용해요; 사람, 팀, 프로젝트, 공간에는 AvatarTag를 사용해요.
  • 상태, 진행도, 우선순위, 권한 같은 의미 있는 속성에는 사용하지 말고 lozenge를 사용해요.
  • trailingMetric prop을 사용해 라벨을 뒷받침하는 수치나 메트릭(예: 하위 태그의 롤업)을 보여줘요.
  • 여러 태그의 레이아웃을 제어하려면 TagGroup을 사용해요.
  • 사용자 생성 텍스트(예: 에디터) 안에서는 태그를 사용하지 마세요.
  • 태그는 비상호작용형, 링크, 또는 제거 가능(isRemovable) 형태가 될 수 있어요.

콘텐츠 지침

  • 명확하고 설명적인 태그 라벨을 사용해요
  • 태그 텍스트를 간결하게 유지해요; 최대 200px을 넘으면 잘려요
  • 관련 콘텐츠를 구성하려는 의도로 색상을 사용해요
  • 사람, 팀, 공간, 프로젝트에는 아바타 태그를 사용해요

접근성 지침

  • 태그에 적절한 라벨을 제공해요
  • 텍스트를 읽을 수 있도록 충분한 색 대비를 보장해요
  • 명확하고 설명적인 태그 텍스트를 사용해요
  • 상호작용형 태그의 키보드 탐색을 고려해요
  • 태그 제거 동작에 대체 텍스트를 제공해요

SimpleTag 컴포넌트

태그는 콘텐츠를 분류하고 구성하는 데 쓰는 미묘하고 컴팩트한 라벨이에요.

  • Keywords: tag, simple, label, category, non-interactive
  • Categories: data-display
  • Status: open-beta

예시

import { Box } from '@atlaskit/primitives/compiled/box';
import Tag from '@atlaskit/tag/tag/simple';
export default (): React.JSX.Element => (
	<Box id="simpleTags" role="group" aria-label="Simple tag examples">
		<Tag text="standard Tag" color="standard" />
		<Tag text="blue Tag" color="blue" />
		<Tag text="green Tag" color="green" />
		<Tag text="teal Tag" color="teal" />
		<Tag text="purple Tag" color="purple" />
		<Tag text="red Tag" color="red" />
		<Tag text="yellow Tag" color="yellow" />
		<Tag text="orange Tag" color="orange" />
		<Tag text="magenta Tag" color="magenta" />
		<Tag text="lime Tag" color="lime" />
		<Tag text="grey Tag" color="grey" />
		<Tag text="greenLight Tag" color="greenLight" />
		<Tag text="tealLight Tag" color="tealLight" />
		<Tag text="blueLight Tag" color="blueLight" />
		<Tag text="purpleLight Tag" color="purpleLight" />
		<Tag text="redLight Tag" color="redLight" />
		<Tag text="yellowLight Tag" color="yellowLight" />
		<Tag text="orangeLight Tag" color="orangeLight" />
		<Tag text="magentaLight Tag" color="magentaLight" />
		<Tag text="limeLight Tag" color="limeLight" />
		<Tag text="greyLight Tag" color="greyLight" />
	</Box>
);

Props

Prop Type Description
appearance "default" | "rounded" Set whether tags are rounded
color "blue" | "gray" | "green" | "grey" | "lime" | "magenta" | "orange" | "purple" | "red" | "teal" | "yellow" | "standard" | "limeLight" | "orangeLight" | "magentaLight" | "greenLight" | ... 5 more ... | "yellowLight" The color theme to apply
elemBefore string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal The component to be rendered before the tag
href string URI or path
linkComponent ComponentClass<any, any> | FunctionComponent<any> A link component to be used instead of our standard anchor
maxWidth string | number Maximum width of the tag text
swatchBeforeLabel string Accessible label for the tag's leading color swatch
swatchBeforeRole "grid" | "article" | "button" | "dialog" | "figure" | "form" | "img" | "link" | "main" | "menu" | "menuitem" | "option" | "search" | "table" | "switch" | "listbox" | "tree" | "status" | ... 51 more ... | "treeitem" The WAI-ARIA role applied to the tag's color swatch element
text string | string[] Text to be displayed in the tag (required)

사용 지침

  • 비상호작용형 분류와 라벨링에 사용해요
  • 객체와 관련된 콘텐츠에 사용해요; 사람/팀에는 AvatarTag를 사용해요
  • 상태 표시에는 사용하지 말고 lozenge를 사용해요
  • 여러 태그의 레이아웃을 제어하려면 TagGroup을 사용해요

콘텐츠 지침

  • 명확하고 설명적인 태그 라벨을 사용해요
  • 태그 텍스트를 간결하게 유지해요
  • 의도적으로 색상을 사용해요

더 알아보기 (Learn more)