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

Label

원문 보기 위키 갱신

폼 컨트롤을 위한 스타일 없고 접근 가능한 label 요소예요.

출처: 문서

본문

특징 (Features)

  • 네이티브 label 요소를 렌더링해요
  • htmlFor로 컨트롤에 연결하거나, 컨트롤을 감싸서 암시적으로 연결할 수 있어요
  • 연결된 컨트롤의 비활성(disabled) 상태를 자동으로 반영해요

사용법 (Usage)

import { Label } from 'primereact/label';
import { InputText } from 'primereact/inputtext';
<Label htmlFor="username">Username</Label>
<InputText id="username" />

API

Label

Attribute Value
data-scope "label"
data-part "root"

접근성 (Accessibility)

스크린 리더 (Screen Reader)

Label은 네이티브 label 요소를 렌더링해요. htmlFor로 폼 컨트롤 id와 연결하거나, 폼 컨트롤을 label 안쪽에 감싸면 돼요.

키보드 지원 (Keyboard Support)

컴포넌트에는 상호작용 가능한 요소가 포함되어 있지 않아요.

더 알아보기 (Learn more)