Featuring Design System
Legacy

CoreSelect

셀렉트 컴포넌트

Deprecated

이 컴포넌트는 더 이상 사용되지 않습니다. 대신 SelectPrim, MultiSelectPrim을 사용하세요.

Usage

기본 사용법 (텍스트 옵션)

import { CoreSelect } from '@featuring-corp/components';

<CoreSelect size="lg" width="240px">
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
	<CoreSelect.Item value="text-3">Option3</CoreSelect.Item>
	<CoreSelect.Item value="text-4">Option4</CoreSelect.Item>
	<CoreSelect.Item value="text-5">Option5</CoreSelect.Item>
</CoreSelect>;

Label 포함

import { CoreSelect } from '@featuring-corp/components';

<CoreSelect label="Label" size="lg" width="240px">
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
	<CoreSelect.Item value="text-3">Option3</CoreSelect.Item>
</CoreSelect>;

Label Element (Tooltip)

import { CoreSelect, CoreTooltip } from '@featuring-corp/components';
import { IconInformationFilled } from '@featuring-corp/icons';
import { vars } from '@styles/theme.css';

<CoreSelect
	label="Label"
	size="lg"
	width="240px"
	labelElement={
		<CoreTooltip text="It's Label Element">
			<IconInformationFilled color={vars.global.colors.gray[50]} />
		</CoreTooltip>
	}
>
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
</CoreSelect>;

Read Only

import { CoreSelect } from '@featuring-corp/components';

<CoreSelect label="Label" size="lg" width="240px" readOnly required>
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
</CoreSelect>;

비활성화

import { CoreSelect } from '@featuring-corp/components';

<CoreSelect label="Label" size="lg" width="240px" disabled>
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
</CoreSelect>;

Helper Text

import { CoreSelect } from '@featuring-corp/components';

<CoreSelect size="lg" width="240px" helperText="Helper Text">
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
</CoreSelect>;

Status와 Validation Text

import { CoreSelect } from '@featuring-corp/components';

<CoreSelect size="lg" width="240px" status="error" validationText="Validation Text">
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
</CoreSelect>;

Leading Element

import { CoreSelect } from '@featuring-corp/components';
import { IconSearchOutline } from '@featuring-corp/icons';

<CoreSelect size="lg" width="240px" leadingElement={<IconSearchOutline />}>
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
</CoreSelect>;

Secondary Label

import { CoreSelect } from '@featuring-corp/components';

<CoreSelect
	size="lg"
	width="340px"
	secondaryLabel={
		<span style={{ color: 'gray' }}>
			<span style={{ color: 'blue' }}>+ 21</span> / 21
		</span>
	}
>
	<CoreSelect.Item value="text-1">Option1</CoreSelect.Item>
	<CoreSelect.Item value="text-2">Option2</CoreSelect.Item>
</CoreSelect>;

Radio 옵션

import { CoreSelect, CoreRadio } from '@featuring-corp/components';

<CoreSelect size="lg" width="240px">
	<CoreSelect.Item value="radio-1">
		<CoreRadio label="Option1" name="radio" />
	</CoreSelect.Item>
	<CoreSelect.Item value="radio-2">
		<CoreRadio label="Option2" name="radio" />
	</CoreSelect.Item>
	<CoreSelect.Item value="radio-3">
		<CoreRadio label="Option3" name="radio" />
	</CoreSelect.Item>
</CoreSelect>;

Checkbox 옵션

import { CoreSelect, CoreCheckbox } from '@featuring-corp/components';

<CoreSelect size="lg" width="240px">
	<CoreSelect.Item value="check-1">
		<CoreCheckbox label="Option1" />
	</CoreSelect.Item>
	<CoreSelect.Item value="check-2">
		<CoreCheckbox label="Option2" />
	</CoreSelect.Item>
	<CoreSelect.Item value="check-3">
		<CoreCheckbox label="Option3" />
	</CoreSelect.Item>
</CoreSelect>;

아이콘과 함께

import { CoreSelect } from '@featuring-corp/components';
import { IconCalendarOutline } from '@featuring-corp/icons';

<CoreSelect size="lg" width="240px">
	<CoreSelect.Item value="icon-1">
		<IconCalendarOutline />
		Option1
	</CoreSelect.Item>
	<CoreSelect.Item value="icon-2">
		<IconCalendarOutline />
		Option2
	</CoreSelect.Item>
</CoreSelect>;

Avatar와 함께

import { CoreSelect, CoreAvatar } from '@featuring-corp/components';

<CoreSelect size="lg" width="240px">
	<CoreSelect.Item value="avatar-1">
		<CoreAvatar src="" size="sm" />
		Option1
	</CoreSelect.Item>
	<CoreSelect.Item value="avatar-2">
		<CoreAvatar src="" size="sm" />
		Option2
	</CoreSelect.Item>
</CoreSelect>;

Checkbox와 Avatar 조합 (많은 옵션)

import { CoreSelect, CoreCheckbox, CoreAvatar } from '@featuring-corp/components';

<CoreSelect size="lg" width="480px" optionHeight="320px" maxShowCount={4} maxTagWidth="80px">
	{Array.from({ length: 50 }).map((_, index) => (
		<CoreSelect.Item key={index} value={`avatar-${index + 1}`} displayValue={`Option${index + 1}`}>
			<CoreCheckbox
				label={
					<div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
						<CoreAvatar size="sm" text={`${index + 1}-Option`} />
						{`Option${index + 1}`}
					</div>
				}
			/>
		</CoreSelect.Item>
	))}
</CoreSelect>;

Props

ComponentPropsWithoutRef<'input'> 타입을 확장한 컴포넌트입니다.

Prop

Type

SizeType

Prop

Type

CoreSelectStatus

Prop

Type

Placement

CoreDropdown을 참조하세요.

스타일

기본 스타일 속성

Select:

  • width: 100% (기본값)
  • position: relative

Hidden Input:

  • position: absolute
  • clip-path: rect(0 0 0 0)
  • width: 0

Label Text:

  • display: flex
  • justify-content: flex-start
  • align-items: center
  • margin-bottom: spacing-150 (6px)
  • typography: heading[1]
  • color: text-2 (기본), text-4 (disabled)

Required:

  • margin-left: spacing-50 (2px)

Label Element:

  • margin-left: spacing-100 (4px)

Select Container:

  • display: flex
  • justify-content: flex-start
  • gap: spacing-200 (8px)
  • padding-x: spacing-250 (10px)
  • border-radius: radius-100
  • border: 1px solid border[1]
  • background-color: background-1 (기본), background-2 (hover)
  • color: text-5 (기본), text-1 (selected)
  • cursor: pointer

Leading Element:

  • width: 16px
  • height: 16px
  • color: icon-secondary (기본), icon-on-color-disabled (readonly/disabled)
  • transition: transform 0.15s ease-out

Trailing Container:

  • display: flex
  • gap: spacing-200 (8px)

Secondary Label:

  • display: flex
  • width: max-content

Trailing Icon:

  • width: 16px
  • height: 16px
  • color: icon-secondary (기본), icon-on-color-disabled (readonly/disabled)
  • transition: transform 0.15s ease-out

Select Item:

  • display: flex
  • gap: spacing-150 (6px)
  • padding-y: spacing-100 (4px)
  • width: 100%
  • overflow: hidden
  • margin: 0
  • white-space: nowrap
  • ms-overflow-style: none
  • scrollbar-width: none

Helper Text:

  • display: flex
  • gap: spacing-100 (4px)
  • margin-top: spacing-100 (4px)
  • typography: body[1]
  • color: text-3

Validation Text:

  • display: flex
  • gap: spacing-100 (4px)
  • margin-top: spacing-100 (4px)
  • typography: body[1]

Dropdown Item:

  • display: flex
  • gap: spacing-150 (6px)
  • border-radius: radius-100
  • min-height: 28px

Dropdown Z-Index:

  • z-index: 10 (기본값)

Size Variants (Container)

  • sm: typography: body[1], min-height: 28px, height: max-content
  • md: typography: body[2], min-height: 32px, height: max-content
  • lg: typography: body[2], min-height: 40px, height: max-content

Size Variants (Dropdown Item)

  • sm: typography: body[1], padding-y: spacing-50 (2px)
  • md: typography: body[2], padding-y: spacing-100 (4px)
  • lg: typography: body[2], padding-y: spacing-200 (8px)

Status Variants (Container)

  • none: border-color: border[1]
  • warning: border-color: support-warning[3]
  • error: border-color: support-error[3]

Validation Text Status Variants

  • none: color: text-3
  • warning: color: support-warning-3
  • error: color: support-error-3

Select Item Variants

  • isInline: on: flex-wrap: nowrap
  • isInline: off: flex-wrap: wrap
  • Disabled (on): hover: cursor: not-allowed
  • Disabled (off): hover: background-color: primary[10], color: primary[100], cursor: pointer

States (상태별 토큰)

Select Container:

  • Default: background-color: background-1, border: 1px solid border[1], color: text[5]
  • Hover: background-color: background-2, border-color: border-2
  • Focus (not readonly, not disabled): border-color: primary[50]
  • Readonly: border-color: border[2], background-color: background[4], color: text[1], cursor: auto
  • Disabled: border-color: border[2], background-color: background[4], color: text[4], cursor: not-allowed
  • Selected (on): color: text[1]
  • Selected (off): 기본 스타일 유지

Leading Element:

  • Default: color: icon-secondary
  • Readonly/Disabled: color: icon-on-color-disabled

Trailing Icon:

  • Default: color: icon-secondary
  • Readonly/Disabled: color: icon-on-color-disabled