셀렉트
셀렉트 (Select)
Select는 여러 옵션 중에서 항목을 선택할 때 사용하는 드롭다운 컴포넌트예요. 기본 사용법부터 체크마크 표시, 필터링, 편집 가능한 입력, 그룹핑, 가상 스크롤까지 다양한 활용 예제를 다뤄요. 접근성 지원과 템플릿 기반·반응형 폼 연동, Props·Emits·테마 설정까지 문서 전반에서 자세히 설명하고 있어요
출처: 문서
본문
접근성
스크린 리더 컴포넌트를 설명하는 값은 ariaLabelledBy 또는 ariaLabel 프롭으로 제공할 수 있어요. select 엘리먼트는 combobox 역할을 하며 여기에 aria-haspopup과 aria-expanded 속성이 더해져요. editable 옵션이 활성화되면 aria-autocomplete도 추가돼요. combobox와 팝업 사이의 관계는 aria-controls로 만들어지고, 팝업 목록 안에서 키보드로 탐색할 때 스크린 리더가 어떤 옵션을 읽어야 할지 알려주는 데는 aria-activedescendant 속성이 사용돼요. 팝업 목록은 combobox 엘리먼트의 aria-controls 속성이 참조하는 id를 가지고 있으며, role로는 listbox를 사용해요. 각 목록 항목은 option 역할과 입력 엘리먼트의 aria-activedescendant와 일치하는 id를 가지고, 여기에 aria-label, aria-selected, aria-disabled 속성도 함께 있어요. 필터링이 활성화되어 있으면 filterInputProps를 정의해서 필터 입력 엘리먼트에 aria-* 프롭을 전달할 수 있어요.
기본
Select는 ngModel 프로퍼티와 options 컬렉션을 함께 사용해서 제어 컴포넌트로 사용돼요. 옵션의 라벨과 값은 각각 optionLabel과 optionValue 프로퍼티로 정의해요. 옵션이 문자열 배열처럼 단순한 원시 값일 때는 optionLabel과 optionValue가 필요 없다는 점에 유의하세요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="cities" [(ngModel)]="selectedCity" optionLabel="name" placeholder="Select a City" class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectBasicDemo implements OnInit {
cities: City[];
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
체크마크
선택된 옵션을 강조하는 또 다른 방법으로는 체크마크를 대신 표시하는 게 있어요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="cities" [(ngModel)]="selectedCity" [checkmark]="true" optionLabel="name" [showClear]="true" placeholder="Select a City" class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectCheckmarkDemo implements OnInit {
cities: City[];
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
클리어 아이콘
showClear가 활성화되면 값을 지울 수 있는 클리어 아이콘이 표시돼요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="cities" [(ngModel)]="selectedCity" optionLabel="name" placeholder="Select a City" class="w-full md:w-56" [showClear]="true" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectCleariconDemo implements OnInit {
cities: City[];
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
customfilter-doc
커스텀 필터는 filterTemplate으로 적용할 수 있어요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ButtonModule } from 'primeng/button';
import { SelectModule } from 'primeng/select';
import { InputGroupModule } from 'primeng/inputgroup';
import { InputTextModule } from 'primeng/inputtext';
import { Country } from '@/domain/customer';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="countries" [(ngModel)]="selectedCountry" optionLabel="name" [filter]="true" filterBy="name" [showClear]="true" placeholder="Select a Country">
<ng-template pTemplate="filter" let-options="options">
<div class="flex gap-1">
<p-inputgroup (click)="$event.stopPropagation()">
<p-inputgroup-addon><i class="pi pi-search"></i></p-inputgroup-addon>
<input type="text" pInputText placeholder="Filter" [(ngModel)]="filterValue" (keyup)="customFilterFunction($event, options)" />
</p-inputgroup>
<p-button icon="pi pi-times" (click)="resetFunction(options)" severity="secondary" />
</div>
</ng-template>
<ng-template pTemplate="selectedItem" let-selectedOption>
<div class="flex items-center gap-2">
<img src="https://primefaces.org/cdn/primeng/images/demo/flag/flag_placeholder.png" [class]="'flag flag-' + selectedCountry.code.toLowerCase()" style="width: 18px" />
<div>{{ selectedOption.name }}</div>
</div>
</ng-template>
<ng-template let-country pTemplate="item">
<div class="flex items-center gap-2">
<img src="https://primefaces.org/cdn/primeng/images/demo/flag/flag_placeholder.png" [class]="'flag flag-' + country.code.toLowerCase()" style="width: 18px" />
<div>{{ country.name }}</div>
</div>
</ng-template>
</p-select>
</div>
`,
standalone: true,
imports: [ButtonModule, SelectModule, InputGroupModule, InputTextModule, FormsModule]
})
export class SelectCustomfilterDemo implements OnInit {
countries: City[] | undefined;
selectedCountry: string | undefined;
filterValue: string | undefined = '';
ngOnInit() {
this.countries = [
{ name: 'Australia', code: 'AU' },
{ name: 'Brazil', code: 'BR' },
{ name: 'China', code: 'CN' },
{ name: 'Egypt', code: 'EG' },
{ name: 'France', code: 'FR' },
{ name: 'Germany', code: 'DE' },
{ name: 'India', code: 'IN' },
{ name: 'Japan', code: 'JP' },
{ name: 'Spain', code: 'ES' },
{ name: 'United States', code: 'US' }
];
}
resetFunction(options: SelectFilterOptions) {
options.reset();
this.filterValue = '';
}
customFilterFunction(event: KeyboardEvent, options: SelectFilterOptions) {
options.filter(event);
}
}
비활성화
disabled가 있으면 엘리먼트를 편집하거나 포커스를 받을 수 없어요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="cities" [(ngModel)]="selectedCity" placeholder="Select a City" optionLabel="name" [disabled]="true" class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectDisabledDemo implements OnInit {
cities: City[] | undefined;
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
편집 가능
editable이 있으면 타이핑으로도 입력값을 직접 입력할 수 있어요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="cities" [(ngModel)]="selectedCity" placeholder="Select a City" [editable]="true" optionLabel="name" class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectEditableDemo implements OnInit {
cities: City[] | undefined;
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
Filled
variant 프로퍼티를 filled로 지정하면 기본 outlined 스타일보다 시각적 강조가 더 강한 모습으로 컴포넌트가 표시돼요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="cities" [(ngModel)]="selectedCity" variant="filled" optionLabel="name" placeholder="Select a City" class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectFilledDemo implements OnInit {
cities: City[];
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
필터
Select는 filter 프로퍼티를 추가하면 활성화되는 내장 필터링 기능을 제공해요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { Country } from '@/domain/customer';
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="countries" [(ngModel)]="selectedCountry" optionLabel="name" [filter]="true" filterBy="name" [showClear]="true" placeholder="Select a Country" class="w-full md:w-56">
<ng-template #selectedItem let-selectedOption>
<div class="flex items-center gap-2">
<img src="https://primefaces.org/cdn/primeng/images/demo/flag/flag_placeholder.png" [class]="'flag flag-' + selectedCountry.code.toLowerCase()" style="width: 18px" />
<div>{{ selectedOption.name }}</div>
</div>
</ng-template>
<ng-template let-country #item>
<div class="flex items-center gap-2">
<img src="https://primefaces.org/cdn/primeng/images/demo/flag/flag_placeholder.png" [class]="'flag flag-' + country.code.toLowerCase()" style="width: 18px" />
<div>{{ country.name }}</div>
</div>
</ng-template>
</p-select>
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectFilterDemo implements OnInit {
countries: any[] | undefined;
selectedCountry: string | undefined;
ngOnInit() {
this.countries = [
{ name: 'Australia', code: 'AU' },
{ name: 'Brazil', code: 'BR' },
{ name: 'China', code: 'CN' },
{ name: 'Egypt', code: 'EG' },
{ name: 'France', code: 'FR' },
{ name: 'Germany', code: 'DE' },
{ name: 'India', code: 'IN' },
{ name: 'Japan', code: 'JP' },
{ name: 'Spain', code: 'ES' },
{ name: 'United States', code: 'US' }
];
}
}
Float Label
포커스가 맞으면 플로팅 라벨이 입력 필드 위에 나타나요. 자세한 내용은 FloatLabel 문서를 확인하세요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { FloatLabelModule } from 'primeng/floatlabel';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex flex-wrap justify-center items-end gap-4">
<p-floatlabel class="w-full md:w-56">
<p-select [(ngModel)]="value1" inputId="over_label" [options]="cities" optionLabel="name" class="w-full" />
<label for="over_label">Over Label</label>
</p-floatlabel>
<p-floatlabel class="w-full md:w-56" variant="in">
<p-select [(ngModel)]="value2" inputId="in_label" [options]="cities" optionLabel="name" class="w-full" variant="filled" />
<label for="in_label">In Label</label>
</p-floatlabel>
<p-floatlabel class="w-full md:w-56" variant="on">
<p-select [(ngModel)]="value3" inputId="on_label" [options]="cities" optionLabel="name" class="w-full" />
<label for="on_label">On Label</label>
</p-floatlabel>
</div>
`,
standalone: true,
imports: [SelectModule, FloatLabelModule, FormsModule]
})
export class SelectFloatlabelDemo implements OnInit {
cities: City[] | undefined;
value1: City | undefined;
value2: City | undefined;
value3: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
Fluid
fluid prop을 true로 설정하면 컴포넌트가 컨테이너의 전체 너비를 차지해요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card">
<p-select [options]="cities" [(ngModel)]="selectedCity" optionLabel="name" placeholder="Select a City" fluid />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectFluidDemo implements OnInit {
cities: City[];
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
Group
중첩된 데이터 구조를 제공하면 옵션들을 그룹으로 묶을 수 있어요.
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { SelectItemGroup } from 'primeng/api';
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="groupedCities" [(ngModel)]="selectedCity" placeholder="Select a City" [group]="true" class="w-full md:w-56">
<ng-template let-group #group>
<div class="flex items-center">
<img src="https://primefaces.org/cdn/primeng/images/demo/flag/flag_placeholder.png" [class]="'mr-2 flag flag-' + group.value" style="width: 20px" />
<span>{{ group.label }}</span>
</div>
</ng-template>
</p-select>
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectGroupDemo {
groupedCities: SelectItemGroup[];
selectedCity: string | undefined;
constructor() {
this.groupedCities = [
{
label: 'Germany',
value: 'de',
items: [
{ label: 'Berlin', value: 'Berlin' },
{ label: 'Frankfurt', value: 'Frankfurt' },
{ label: 'Hamburg', value: 'Hamburg' },
{ label: 'Munich', value: 'Munich' }
]
},
{
label: 'USA',
value: 'us',
items: [
{ label: 'Chicago', value: 'Chicago' },
{ label: 'Los Angeles', value: 'Los Angeles' },
{ label: 'New York', value: 'New York' },
{ label: 'San Francisco', value: 'San Francisco' }
]
},
{
label: 'Japan',
value: 'jp',
items: [
{ label: 'Kyoto', value: 'Kyoto' },
{ label: 'Osaka', value: 'Osaka' },
{ label: 'Tokyo', value: 'Tokyo' },
{ label: 'Yokohama', value: 'Yokohama' }
]
}
];
}
}
Ifta Label
IftaLabel은 필드 안에 상단 정렬된 라벨을 만들 때 사용해요. 자세한 내용은 IftaLabel 문서를 확인하세요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { IftaLabelModule } from 'primeng/iftalabel';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-iftalabel class="w-full md:w-56">
<p-select [(ngModel)]="selectedCity" inputId="dd-city" [options]="cities" optionLabel="name" class="w-full" />
<label for="dd-city">City</label>
</p-iftalabel>
</div>
`,
standalone: true,
imports: [SelectModule, IftaLabelModule, FormsModule]
})
export class SelectIftalabelDemo implements OnInit {
cities: City[] | undefined;
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
Invalid
유효성 검사 실패를 나타내는 invalid 상태는 invalid 속성으로 적용하며, Angular Forms와 통합할 수 있어요.
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center gap-4">
<p-select [options]="cities" [(ngModel)]="selectedCity1" optionLabel="name" [showClear]="true" [invalid]="value1" placeholder="Select a City" class="w-full md:w-56" />
<p-select [options]="cities" [(ngModel)]="selectedCity2" optionLabel="name" [showClear]="true" [invalid]="value2" placeholder="Select a City" class="w-full md:w-56" variant="filled" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectInvalidDemo {
cities: City[];
selectedCity1: City | undefined;
selectedCity2: City | undefined;
value1: boolean = true;
value2: boolean = true;
}
Lazy Virtual Scroll
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { SelectItem } from 'primeng/api';
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="items" [(ngModel)]="selectedItem" placeholder="Select Item" [virtualScroll]="true" [virtualScrollItemSize]="32" [virtualScrollOptions]="options" class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectLazyvirtualscrollDemo {
items: SelectItem[];
selectedItem: string | undefined;
loading: boolean = false;
loadLazyTimeout: any = null;
options: ScrollerOptions;
constructor() {
this.items = [];
for (let i = 0; i < 10000; i++) {
this.items.push({ label: 'Item ' + i, value: 'Item ' + i });
}
}
onLazyLoad(event) {
this.loading = true;
if (this.loadLazyTimeout) {
clearTimeout(this.loadLazyTimeout);
}
//imitate delay of a backend call
this.loadLazyTimeout = setTimeout(
() => {
const { first, last } = event;
const items = [...this.items];
for (let i = first; i < last; i++) {
items[i] = { label: `Item #${i}`, value: i };
}
this.items = items;
this.loading = false;
},
Math.random() * 1000 + 250
);
}
}
Loading State
로딩 상태는 loading 속성으로 사용할 수 있어요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="cities" [(ngModel)]="selectedCity" [loading]="true" optionLabel="name" placeholder="Loading..." class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectLoadingstateDemo implements OnInit {
cities: City[];
selectedCity: City | undefined;
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
reactiveforms-doc
Select는 리액티브 폼과도 함께 사용할 수 있어요. 이 경우 formControlName 속성을 사용해서 컴포넌트를 폼 컨트롤에 바인딩해요.
import { Component, inject } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { MessageModule } from 'primeng/message';
import { ToastModule } from 'primeng/toast';
import { ButtonModule } from 'primeng/button';
import { MessageService } from 'primeng/api';
interface City {
name: string;
code: string;
}
@Component({
template: `
<p-toast />
<div class="card flex justify-center">
<form [formGroup]="exampleForm" (ngSubmit)="onSubmit()" class="flex flex-col gap-4 w-full sm:w-56">
<div class="flex flex-col gap-1">
<p-select formControlName="city" [options]="cities" [invalid]="isInvalid('city')" optionLabel="name" placeholder="Select a City" class="w-full md:w-56" />
@if (isInvalid('city')) {
<p-message severity="error" size="small" variant="simple">City is required.</p-message>
}
</div>
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
</form>
</div>
`,
standalone: true,
imports: [SelectModule, MessageModule, ToastModule, ButtonModule, ReactiveFormsModule]
})
export class SelectReactiveformsDemo {
messageService = inject(MessageService);
cities: City[];
exampleForm: FormGroup | undefined;
formSubmitted: boolean = false;
constructor() {
this.exampleForm = this.fb.group({
city: ['', Validators.required]
});
}
onSubmit() {
this.formSubmitted = true;
if (this.exampleForm.valid) {
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form is submitted', life: 3000 });
this.exampleForm.reset();
this.formSubmitted = false;
}
}
isInvalid(controlName: string) {
const control = this.exampleForm.get(controlName);
return control?.invalid && (control.touched || this.formSubmitted);
}
}
Sizes
Select는 기본 크기 외에 small과 large 크기를 대안으로 제공해요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
interface City {
name: string;
code: string;
}
@Component({
template: `
<div class="card flex flex-col items-center gap-4">
<p-select [(ngModel)]="value1" [options]="cities" optionLabel="name" size="small" placeholder="Small" class="w-full md:w-56" />
<p-select [(ngModel)]="value2" [options]="cities" optionLabel="name" placeholder="Normal" class="w-full md:w-56" />
<p-select [(ngModel)]="value3" [options]="cities" optionLabel="name" size="large" placeholder="Large" class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectSizesDemo implements OnInit {
value1: City | undefined;
value2: City | undefined;
value3: City | undefined;
cities: City[];
ngOnInit() {
this.cities = [
{ name: 'New York', code: 'NY' },
{ name: 'Rome', code: 'RM' },
{ name: 'London', code: 'LDN' },
{ name: 'Istanbul', code: 'IST' },
{ name: 'Paris', code: 'PRS' }
];
}
}
Template
선택된 옵션과 옵션 목록 모두 커스터마이즈된 표현을 제공하기 위해 템플릿으로 만들 수 있어요. selectedItem 템플릿을 사용해 선택된 라벨 표시를 커스터마이즈하고, item 템플릿을 사용해 셀렉트 패널 안 옵션의 내용을 바꿀 수 있어요. 또한 grouping이 활성화되면 group 템플릿으로 옵션 그룹을 커스터마이즈할 수 있어요. 모든 템플릿은 기본 로컬 템플릿 변수로 옵션 인스턴스를 받아요.
import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ButtonModule } from 'primeng/button';
import { SelectModule } from 'primeng/select';
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="countries" [(ngModel)]="selectedCountry" optionLabel="name" placeholder="Select a country" class="w-full md:w-56">
<ng-template #selectedItem let-selectedOption>
<div class="flex items-center gap-2" *ngIf="selectedOption">
<img src="https://primefaces.org/cdn/primeng/images/demo/flag/flag_placeholder.png" [class]="'flag flag-' + selectedOption.code.toLowerCase()" style="width: 18px" />
<div>{{ selectedOption.name }}</div>
</div>
</ng-template>
<ng-template let-country #item>
<div class="flex items-center gap-2">
<img src="https://primefaces.org/cdn/primeng/images/demo/flag/flag_placeholder.png" [class]="'flag flag-' + country.code.toLowerCase()" style="width: 18px" />
<div>{{ country.name }}</div>
</div>
</ng-template>
<ng-template #dropdownicon>
<i class="pi pi-map"></i>
</ng-template>
<ng-template #header>
<div class="font-medium p-3">Available Countries</div>
</ng-template>
<ng-template #footer>
<div class="p-3">
<p-button label="Add New" fluid severity="secondary" text size="small" icon="pi pi-plus" />
</div>
</ng-template>
</p-select>
</div>
`,
standalone: true,
imports: [ButtonModule, SelectModule, FormsModule]
})
export class SelectTemplateDemo implements OnInit {
countries: any[] | undefined;
selectedCountry: string | undefined;
ngOnInit() {
this.countries = [
{ name: 'Australia', code: 'AU' },
{ name: 'Brazil', code: 'BR' },
{ name: 'China', code: 'CN' },
{ name: 'Egypt', code: 'EG' },
{ name: 'France', code: 'FR' },
{ name: 'Germany', code: 'DE' },
{ name: 'India', code: 'IN' },
{ name: 'Japan', code: 'JP' },
{ name: 'Spain', code: 'ES' },
{ name: 'United States', code: 'US' }
];
}
}
templatedrivenforms-doc
import { Component, inject } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { MessageModule } from 'primeng/message';
import { ToastModule } from 'primeng/toast';
import { ButtonModule } from 'primeng/button';
import { MessageService } from 'primeng/api';
interface City {
name: string;
code: string;
}
@Component({
template: `
<p-toast />
<div class="card flex justify-center">
<form #exampleForm="ngForm" (ngSubmit)="onSubmit(exampleForm)" class="flex flex-col gap-4 w-full sm:w-56">
<div class="flex flex-col gap-1">
<p-select
#city="ngModel"
[(ngModel)]="selectedCity"
[options]="cities"
[invalid]="city.invalid && (city.touched || exampleForm.submitted)"
optionLabel="name"
name="city"
placeholder="Select a City"
class="w-full md:w-56"
required
/>
@if (city.invalid && (city.touched || exampleForm.submitted)) {
<p-message severity="error" size="small" variant="simple">City is required.</p-message>
}
</div>
<button pButton severity="secondary" type="submit"><span pButtonLabel>Submit</span></button>
</form>
</div>
`,
standalone: true,
imports: [SelectModule, MessageModule, ToastModule, ButtonModule, FormsModule]
})
export class SelectTemplatedrivenformsDemo {
messageService = inject(MessageService);
cities: City[];
selectedCity: City | undefined;
onSubmit(form: any) {
if (form.valid) {
this.messageService.add({ severity: 'success', summary: 'Success', detail: 'Form Submitted', life: 3000 });
form.resetForm();
}
}
}
Virtual Scroll
VirtualScrolling은 뷰포트에 데이터의 작은 일부만 표시하는 방식으로 옵션을 렌더링하는 효율적인 방법이에요. 아주 많은 수의 옵션을 다룰 때는 성능 문제를 피하기 위해 VirtualScrolling을 활성화하는 게 권장돼요. 사용법은 간단해서 virtualScroll 속성을 true로 설정하고 virtualScrollItemSize를 정의해 아이템의 높이를 지정하기만 하면 돼요.
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SelectModule } from 'primeng/select';
import { SelectItem } from 'primeng/api';
@Component({
template: `
<div class="card flex justify-center">
<p-select [options]="items" [(ngModel)]="selectedItem" placeholder="Select Item" [virtualScroll]="true" [virtualScrollItemSize]="32" class="w-full md:w-56" />
</div>
`,
standalone: true,
imports: [SelectModule, FormsModule]
})
export class SelectVirtualscrollDemo {
items: SelectItem[];
selectedItem: string | undefined;
constructor() {
this.items = [];
for (let i = 0; i < 10000; i++) {
this.items.push({ label: 'Item ' + i, value: 'Item ' + i });
}
}
}
Select
Select는 옵션 컬렉션에서 아이템을 선택할 때 사용해요.
프로퍼티
| 이름 | 타입 | 기본값 | 설명 |
|---|---|---|---|
| dt | InputSignal | undefined | 컴포넌트의 스코프 디자인 토큰을 정의해요. |
| unstyled | InputSignal | undefined | 컴포넌트를 스타일 없이 렌더링할지 여부를 나타내요. |
| pt | InputSignal | undefined | 컴포넌트 내부의 DOM 요소에 속성을 전달하는 데 사용해요. |
| ptOptions | InputSignal | undefined | 컴포넌트의 passthrough(pt) 옵션을 구성하는 데 사용해요. |
| required | InputSignalWithTransform<boolean, unknown> | false | (설정된 경우) 값이 반드시 있어야 해요. |
| invalid | InputSignalWithTransform<boolean, unknown> | false | 설정하면 컴포넌트가 invalid 상태 스타일을 가져야 함을 지정해요. |
| disabled | InputSignalWithTransform<boolean, unknown> | false | 설정하면 컴포넌트가 disabled 상태 스타일을 가져야 함을 지정해요. |
| name | InputSignal | undefined | 설정하면 input의 name을 지정해요. |
| fluid | InputSignalWithTransform<boolean, unknown> | false | 활성화하면 컨테이너 너비의 100%를 차지해요. |
| variant | InputSignal<"outlined" | "filled"> | 'outlined' | 컴포넌트의 input variant를 지정해요. |
| size | InputSignal<"small" | "large"> | undefined | 컴포넌트의 크기를 지정해요. |
| inputSize | InputSignal | undefined | input 요소의 보이는 너비를 문자 단위로 지정해요. |
| pattern | InputSignal | undefined | 값이 패턴과 일치해야 함을 지정해요. |
| min | InputSignal | undefined | 값이 이 값보다 크거나 같아야 해요. |
| max | InputSignal | undefined | 값이 이 값보다 작거나 같아야 해요. |
| step | InputSignal | undefined | step이 any 리터럴로 설정되지 않는 한, 값은 min + step의 정수 배여야 해요. |
| minlength | InputSignal | undefined | 비어 있지 않은 경우, 문자 수(코드 포인트)가 이 속성의 값보다 작아서는 안 돼요. |
| maxlength | InputSignal | undefined | 문자 수(코드 포인트)가 이 속성의 값을 초과해서는 안 돼요. |
| id | string | - | 컴포넌트의 고유 식별자예요. |
| scrollHeight | string | 200px | 뷰포트의 높이(픽셀 단위)예요. 목록의 높이가 이 값을 초과하면 스크롤바가 표시돼요. |
| filter | boolean | false | 설정하면 keyup 시 항목을 필터링하기 위한 input 필드를 표시해요. |
| panelStyle | { [klass: string]: any } | - | 오버레이 패널 요소의 인라인 스타일이에요. |
| styleClass | string | - | 요소의 스타일 클래스예요. (지원 중단됨) |
| panelStyleClass | string | - | 오버레이 패널 요소의 스타일 클래스예요. |
| readonly | boolean | false | 설정하면 컴포넌트를 편집할 수 없음을 지정해요. |
| editable | boolean | false | 설정하면 미리 정의된 옵션 대신 편집 가능한 input 필드로 사용자 지정 값을 입력할 수 있어요. |
| tabindex | number | 0 | 탭 순서에서의 요소 인덱스예요. |
| placeholder | Signal | - | 옵션이 선택되지 않았을 때 표시되는 기본 텍스트예요. |
| loadingIcon | string | - | 로딩 상태에서 표시할 아이콘이에요. |
| filterPlaceholder | string | - | 필터 input이 비어 있을 때 표시할 플레이스홀더 텍스트예요. |
| filterLocale | string | - | 필터링에 사용할 로캘이에요. 기본 로캘은 호스트 환경의 현재 로캘이에요. |
| inputId | string | - | 접근 가능한 input 요소의 식별자예요. |
| dataKey | string | - | 옵션에서 값을 고유하게 식별하기 위한 속성이에요. |
| filterBy | string | - | 필터링이 활성화되면 filterBy가 검색할 필드(쉼표로 구분)를 결정해요. |
| filterFields | any[] | - | 옵션을 필터링할 때 사용되는 필드예요. 기본값은 optionLabel이에요. |
| autofocus | boolean | false | 설정하면 로드 시 컴포넌트가 자동으로 포커스를 받아야 함을 지정해요. |
| resetFilterOnHide | boolean | false | select를 숨길 때 필터 값을 지워요. |
| checkmark | boolean | false | 선택된 옵션을 체크 마크와 함께 표시할지 여부예요. |
| dropdownIcon | string | - | select 아이콘의 아이콘 클래스예요. |
| loading | boolean | false | select가 로딩 상태인지 여부예요. |
| optionLabel | string | - | 옵션의 label 필드 이름이에요. |
| optionValue | string | - | 옵션의 value 필드 이름이에요. |
| optionDisabled | string | - | 옵션의 disabled 필드 이름이에요. |
| optionGroupLabel | string | label | 옵션 그룹의 label 필드 이름이에요. |
| optionGroupChildren | string | items | 옵션 그룹의 options 필드 이름이에요. |
| group | boolean | false | 중첩된 옵션이 제공됐을 때 옵션을 그룹으로 표시할지 여부예요. |
| showClear | boolean | false | 활성화하면 값을 지우는 clear 아이콘이 표시돼요. |
| emptyFilterMessage | string | - | 필터링 결과가 없을 때 표시할 텍스트예요. i18n 번역 설정의 전역 값이 기본값이에요. |
| emptyMessage | string | - | 데이터가 없을 때 표시할 텍스트예요. i18n 번역 설정의 전역 값이 기본값이에요. |
| lazy | boolean | false | 데이터를 lazy 방식으로 로드하고 상호작용할지 정의해요. |
| virtualScroll | boolean | false | 스크롤 중에 데이터를 요청 시에 로드할지 여부예요. |
| virtualScrollItemSize | number | - | VirtualScrolling에서 목록 항목의 높이예요. |
| virtualScrollOptions | ScrollerOptions | - | scroller 기능을 사용할지 여부예요. scroller 컴포넌트의 속성을 객체 형태로 넣어 사용할 수 있어요. |
| overlayOptions | OverlayOptions | - | overlay API 기능을 사용할지 여부예요. overlay API의 속성을 객체 형태로 넣어 사용할 수 있어요. |
| ariaFilterLabel | string | - | 필터 input의 레이블이 되는 문자열을 정의해요. |
| ariaLabel | string | - | 현재 요소에 aria label 속성을 정의하는 데 사용해요. |
| ariaLabelledBy | string | - | 컴포넌트와 레이블 사이에 관계를 설정해요. 값은 하나 이상의 요소 ID여야 해요. |
| filterMatchMode | "startsWith" | "contains" | "endsWith" | "equals" | "notEquals" | "in" | "lt" | "lte" | "gt" | "gte" | contains | 항목을 필터링하는 방식을 정의해요. |
| tooltip | string | - | 호버 시 툴팁에 표시할 안내 정보예요. |
| tooltipPosition | "right" | "left" | "top" | "bottom" | right | 툴팁의 위치예요. |
| tooltipPositionStyle | string | absolute | CSS position 유형이에요. |
| tooltipStyleClass | string | - | 툴팁의 스타일 클래스예요. |
| focusOnHover | boolean | true | 옵션을 필터링할 때 사용되는 필드예요. 기본값은 optionLabel이에요. |
| selectOnFocus | boolean | false | 포커스 시 옵션을 선택할지 결정해요. |
| autoOptionFocus | boolean | false | 오버레이 패널이 표시될 때 보이는 첫 번째 요소 또는 선택된 요소에 포커스를 맞출지 여부예요. |
| autofocusFilter | boolean | true | 오버레이가 표시될 때 필터 요소에 포커스를 적용해요. |
| filterValue | string | - | 설정하면 필터가 이 값을 가진 채 표시돼요. |
| options | any[] | - | 사용 가능한 옵션으로 표시할 객체 배열이에요. |
| appendTo | InputSignal | 'self' | 오버레이를 붙일 대상 요소예요. 유효한 값은 "body" 또는 다른 요소의 로컬 ng-template 변수예요 (참고: 템플릿 변수에는 대괄호를 사용한 바인딩을 사용하세요. 예를 들어 변수 이름이 #mydiv인 div 요소에는 [appendTo]="mydiv"를 사용해요). |
| motionOptions | InputSignal | ... | 모션 옵션이에요. |
이벤트
| 이름 | 파라미터 | 설명 |
|---|---|---|
| onChange | event: SelectChangeEvent | select의 값이 변경될 때 호출되는 콜백이에요. |
| onFilter | event: SelectFilterEvent | 데이터가 필터링될 때 호출되는 콜백이에요. |
| onFocus | event: Event | select가 포커스를 받을 때 호출되는 콜백이에요. |
| onBlur | event: Event | select가 포커스를 잃을 때 호출되는 콜백이에요. |
| onClick | event: MouseEvent | 컴포넌트가 클릭될 때 호출되는 콜백이에요. |
| onShow | event: AnimationEvent | select 오버레이가 표시될 때 호출되는 콜백이에요. |
| onHide | event: AnimationEvent | select 오버레이가 숨겨질 때 호출되는 콜백이에요. |
| onClear | event: Event | select가 값을 지울 때 호출되는 콜백이에요. |
| onLazyLoad | event: SelectLazyLoadEvent | lazy 모드에서 새 데이터를 로드할 때 호출되는 콜백이에요. |
템플릿
| 이름 | 타입 | 설명 |
|---|---|---|
| item | TemplateRef<SelectItemTemplateContext> | 사용자 지정 항목 템플릿이에요. |
| group | TemplateRef<SelectGroupTemplateContext> | 사용자 지정 그룹 템플릿이에요. |
| loader | TemplateRef | 사용자 지정 로더 템플릿이에요. |
| selecteditem | TemplateRef<SelectSelectedItemTemplateContext> | 사용자 지정 선택 항목 템플릿이에요. |
| header | TemplateRef | 사용자 지정 헤더 템플릿이에요. |
| filter | TemplateRef | 사용자 지정 필터 템플릿이에요. |
| footer | TemplateRef | 사용자 지정 푸터 템플릿이에요. |
| emptyfilter | TemplateRef | 사용자 지정 빈 필터 템플릿이에요. |
| empty | TemplateRef | 사용자 지정 빈 템플릿이에요. |
| dropdownicon | TemplateRef | 사용자 지정 드롭다운 아이콘 템플릿이에요. |
| loadingicon | TemplateRef | 사용자 지정 로딩 아이콘 템플릿이에요. |
| clearicon | TemplateRef | 사용자 지정 clear 아이콘 템플릿이에요. |
| filtericon | TemplateRef | 사용자 지정 필터 아이콘 템플릿이에요. |
| onicon | TemplateRef | 사용자 지정 on 아이콘 템플릿이에요. |
| officon | TemplateRef | 사용자 지정 off 아이콘 템플릿이에요. |
| cancelicon | TemplateRef | 사용자 지정 취소 아이콘 템플릿이에요. |
메서드
| 이름 | 파라미터 | 반환 타입 | 설명 |
|---|---|---|---|
| resetFilter | void | 필터 초기화 시 호출되는 콜백이에요. | |
| show | isFocus: any | void | 패널을 표시해요. |
| hide | isFocus: any | void | 패널을 숨겨요. |
| focus | void | 포커스를 적용해요. | |
| clear | event: Event | void | 모델을 지워요. |
패스 스루 옵션
| 이름 | 타입 | 설명 |
|---|---|---|
| root | PassThroughOption<HTMLSpanElement, I> | 루트의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| label | PassThroughOption<HTMLSpanElement | HTMLInputElement, I> | 레이블의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| clearIcon | PassThroughOption<HTMLElement, I> | 클리어 아이콘의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| dropdown | PassThroughOption<HTMLDivElement, I> | 드롭다운의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| loadingIcon | PassThroughOption<HTMLSpanElement, I> | 로딩 아이콘의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| dropdownIcon | PassThroughOption<HTMLElement, I> | 드롭다운 아이콘의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| pcOverlay | OverlayPassThrough | Overlay 컴포넌트에 속성을 전달하는 데 사용해요. |
| header | PassThroughOption<HTMLDivElement, I> | 헤더의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| pcFilterContainer | IconFieldPassThrough | 필터 컨테이너의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| pcFilter | InputTextPassThrough | 필터 입력의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| pcFilterIconContainer | InputIconPassThrough | 필터 아이콘 컨테이너의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| filterIcon | PassThroughOption<HTMLElement, I> | 필터 아이콘의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| listContainer | PassThroughOption<HTMLDivElement, I> | 리스트 컨테이너의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| virtualScroller | VirtualScrollerPassThrough | VirtualScroller 컴포넌트에 속성을 전달하는 데 사용해요. |
| list | PassThroughOption<HTMLUListElement, I> | 리스트의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| optionGroup | PassThroughOption<HTMLLIElement, I> | 옵션 그룹의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| optionGroupLabel | PassThroughOption<HTMLSpanElement, I> | 옵션 그룹 레이블의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| option | PassThroughOption<HTMLLIElement, I> | 옵션의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| optionCheckIcon | PassThroughOption<HTMLElement, I> | 옵션 체크 아이콘의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| optionBlankIcon | PassThroughOption<HTMLElement, I> | 옵션 블랭크 아이콘의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| optionLabel | PassThroughOption<HTMLSpanElement, I> | 옵션 레이블의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| emptyMessage | PassThroughOption<HTMLLIElement, I> | 빈 메시지의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| hiddenFirstFocusableEl | PassThroughOption<HTMLSpanElement, I> | 숨겨진 첫 번째 포커스 가능 엘리먼트의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| hiddenFilterResult | PassThroughOption<HTMLSpanElement, I> | 숨겨진 필터 결과의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| hiddenEmptyMessage | PassThroughOption<HTMLSpanElement, I> | 숨겨진 빈 메시지의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| hiddenSelectedMessage | PassThroughOption<HTMLSpanElement, I> | 숨겨진 선택 메시지의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
| hiddenLastFocusableEl | PassThroughOption<HTMLSpanElement, I> | 숨겨진 마지막 포커스 가능 엘리먼트의 DOM 엘리먼트에 속성을 전달하는 데 사용해요. |
테마
CSS 클래스
| 클래스 | 설명 |
|---|---|
| p-select | 루트 엘리먼트의 클래스 이름이에요. |
| p-select-label | 레이블 엘리먼트의 클래스 이름이에요. |
| p-select-clear-icon | 클리어 아이콘 엘리먼트의 클래스 이름이에요. |
| p-select-dropdown | 드롭다운 엘리먼트의 클래스 이름이에요. |
| p-select-loading-icon | 로딩 아이콘 엘리먼트의 클래스 이름이에요. |
| p-select-dropdown-icon | 드롭다운 아이콘 엘리먼트의 클래스 이름이에요. |
| p-select-overlay | 오버레이 엘리먼트의 클래스 이름이에요. |
| p-select-header | 헤더 엘리먼트의 클래스 이름이에요. |
| p-select-filter | 필터 엘리먼트의 클래스 이름이에요. |
| p-select-list-container | 리스트 컨테이너 엘리먼트의 클래스 이름이에요. |
| p-select-list | 리스트 엘리먼트의 클래스 이름이에요. |
| p-select-option-group | 옵션 그룹 엘리먼트의 클래스 이름이에요. |
| p-select-option-group-label | 옵션 그룹 레이블 엘리먼트의 클래스 이름이에요. |
| p-select-option | 옵션 엘리먼트의 클래스 이름이에요. |
| p-select-option-label | 옵션 레이블 엘리먼트의 클래스 이름이에요. |
| p-select-option-check-icon | 옵션 체크 아이콘 엘리먼트의 클래스 이름이에요. |
| p-select-option-blank-icon | 옵션 블랭크 아이콘 엘리먼트의 클래스 이름이에요. |
| p-select-empty-message | 빈 메시지 엘리먼트의 클래스 이름이에요. |
디자인 토큰
| 토큰 | CSS 변수 | 설명 |
|---|---|---|
| select.background | --p-select-background | 루트의 배경이에요. |
| select.disabled.background | --p-select-disabled-background | 루트의 비활성 배경이에요. |
| select.filled.background | --p-select-filled-background | 루트의 채워진 배경이에요. |
| select.filled.hover.background | --p-select-filled-hover-background | 루트의 채워진 호버 배경이에요. |
| select.filled.focus.background | --p-select-filled-focus-background | 루트의 채워진 포커스 배경이에요. |
| select.border.color | --p-select-border-color | 루트의 테두리 색상이에요. |
| select.hover.border.color | --p-select-hover-border-color | 루트의 호버 테두리 색상이에요. |
| select.focus.border.color | --p-select-focus-border-color | 루트의 포커스 테두리 색상이에요. |
| select.invalid.border.color | --p-select-invalid-border-color | 루트의 유효하지 않은 테두리 색상이에요. |
| select.color | --p-select-color | 루트의 색상이에요. |
| select.disabled.color | --p-select-disabled-color | 루트의 비활성 색상이에요. |
| select.placeholder.color | --p-select-placeholder-color | 루트의 플레이스홀더 색상이에요. |
| select.invalid.placeholder.color | --p-select-invalid-placeholder-color | 루트의 유효하지 않은 플레이스홀더 색상이에요. |
| select.shadow | --p-select-shadow | 루트의 그림자예요. |
| select.padding.x | --p-select-padding-x | 루트의 가로 패딩이에요. |
| select.padding.y | --p-select-padding-y | 루트의 세로 패딩이에요. |
| select.border.radius | --p-select-border-radius | 루트의 테두리 반경이에요. |
| select.focus.ring.width | --p-select-focus-ring-width | 루트의 포커스 링 두께예요. |
| select.focus.ring.style | --p-select-focus-ring-style | 루트의 포커스 링 스타일이에요. |
| select.focus.ring.color | --p-select-focus-ring-color | 루트의 포커스 링 색상이에요. |
| select.focus.ring.offset | --p-select-focus-ring-offset | 루트의 포커스 링 오프셋이에요. |
| select.focus.ring.shadow | --p-select-focus-ring-shadow | 루트의 포커스 링 그림자예요. |
| select.transition.duration | --p-select-transition-duration | 루트의 전환 지속 시간이에요. |
| select.sm.font.size | --p-select-sm-font-size | 루트의 Sm 폰트 크기예요. |
| select.sm.padding.x | --p-select-sm-padding-x | 루트의 Sm 가로 패딩이에요. |
| select.sm.padding.y | --p-select-sm-padding-y | 루트의 Sm 세로 패딩이에요. |
| select.lg.font.size | --p-select-lg-font-size | 루트의 Lg 폰트 크기예요. |
| select.lg.padding.x | --p-select-lg-padding-x | 루트의 Lg 가로 패딩이에요. |
| select.lg.padding.y | --p-select-lg-padding-y | 루트의 Lg 세로 패딩이에요. |
| select.dropdown.width | --p-select-dropdown-width | 드롭다운의 너비예요. |
| select.dropdown.color | --p-select-dropdown-color | 드롭다운의 색상이에요. |
| select.overlay.background | --p-select-overlay-background | 오버레이의 배경이에요. |
| select.overlay.border.color | --p-select-overlay-border-color | 오버레이의 테두리 색상이에요. |
| select.overlay.border.radius | --p-select-overlay-border-radius | 오버레이의 테두리 반경이에요. |
| select.overlay.color | --p-select-overlay-color | 오버레이의 색상이에요. |
| select.overlay.shadow | --p-select-overlay-shadow | 오버레이의 그림자예요. |
| select.list.padding | --p-select-list-padding | 리스트의 패딩이에요. |
| select.list.gap | --p-select-list-gap | 리스트의 간격이에요. |
| select.list.header.padding | --p-select-list-header-padding | 리스트의 헤더 패딩이에요. |
| select.option.focus.background | --p-select-option-focus-background | 옵션의 포커스 배경이에요. |
| select.option.selected.background | --p-select-option-selected-background | 옵션의 선택된 배경이에요. |
| select.option.selected.focus.background | --p-select-option-selected-focus-background | 옵션의 선택된 포커스 배경이에요. |
| select.option.color | --p-select-option-color | 옵션의 색상이에요. |
| select.option.focus.color | --p-select-option-focus-color | 옵션의 포커스 색상이에요. |
| select.option.selected.color | --p-select-option-selected-color | 옵션의 선택된 색상이에요. |
| select.option.selected.focus.color | --p-select-option-selected-focus-color | 옵션의 선택된 포커스 색상이에요. |
| select.option.padding | --p-select-option-padding | 옵션의 패딩이에요. |
| select.option.border.radius | --p-select-option-border-radius | 옵션의 테두리 반경이에요. |
| select.option.group.background | --p-select-option-group-background | 옵션 그룹의 배경이에요. |
| select.option.group.color | --p-select-option-group-color | 옵션 그룹의 색상이에요. |
| select.option.group.font.weight | --p-select-option-group-font-weight | 옵션 그룹의 폰트 두께예요. |
| select.option.group.padding | --p-select-option-group-padding | 옵션 그룹의 패딩이에요. |
| select.clear.icon.color | --p-select-clear-icon-color | 클리어 아이콘의 색상이에요. |
| select.checkmark.color | --p-select-checkmark-color | 체크마크의 색상이에요. |
| select.checkmark.gutter.start | --p-select-checkmark-gutter-start | 체크마크의 거터 시작이에요. |
| select.checkmark.gutter.end | --p-select-checkmark-gutter-end | 체크마크의 거터 끝이에요. |
| select.empty.message.padding | --p-select-empty-message-padding | 빈 메시지의 패딩이에요. |
더 알아보기 (Learn more)
이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.