IftaLabel
라벨을 폼 요소와 시각적으로 통합해 주는 컴포넌트예요. 필드 안쪽 위쪽에 정렬된 라벨을 만들 때 써요.
출처: 문서
본문
IftaLabel은 라벨을 폼 요소와 시각적으로 통합해 줘요.
사용법 (Usage)
import { IftaLabel } from '@primereact/ui/iftalabel';
<IftaLabel></IftaLabel>
예제 (Examples)
기본 (Basic)
입력 필드 경계 안쪽, 위쪽에 정렬된 라벨이에요.
유효하지 않음 (Invalid)
폼 요소가 유효하지 않을 때 라벨도 함께 강조 표시돼요.
접근성 (Accessibility)
스크린 리더 (Screen Reader)
IftaLabel은 어떤 역할(role)이나 속성도 요구하지 않아요.
키보드 지원 (Keyboard Support)
이 컴포넌트에는 상호작용 요소가 포함되어 있지 않아요.
IftaLabel API
IftaLabel 컴포넌트의 API 문서예요
IftaLabel
Props
| Name | Type | Default | Description |
|---|---|---|---|
| ref | Ref | null | The reference to the component instance. |
| pIf | boolean | true | Whether the component should be rendered. |
| style | CSSProperties | ((instance?: IftaLabelInstance) => undefined | CSSProperties) | null | The style to apply to the component. |
| className | string | ((instance?: IftaLabelInstance) => undefined | string) | null | The class name to apply to the component. |
| as | null | string | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent | ReactElement<unknown, string | JSXElementConstructor> | Iterable<ReactNode, any, any> | ReactPortal | Promise | null | The component type to render. |
| asChild | boolean | false | Whether the component should be rendered as a child component. |
| instance | IftaLabelInstance | null | The instance to pass to the component. |
| pt | SafeRecord | null | The pass-through props to pass to the component. |
| ptOptions | PassThroughOptions | null | The pass-through options to pass to the component. |
| unstyled | boolean | null | Whether the component should be rendered without classes. |
| dt | unknown | null | The design token to use for the component. |
| styles | StylesOptions | null | The styles to use for the component. |
| render | (instance: IftaLabelInstance) => ReactNode | null | The render function to render the component with instance access. |
| children | any | null | The children to render. |
Accepts React.ReactNode for static content or a render function (instance: I) => React.ReactNode for instance access.
Typed as any to avoid JSX type errors when used directly in templates. |
| [key: string] | any | null | |
| pt-{optionName}-* | - | null | Pass through attributes for customizing component. For more info, see Pass Through tab. |
State
Exposes
| Name | Type | Default | Description |
|---|---|---|---|
| rootProps | UseIftaLabelRootProps | null | Pre-built data attribute props for the root element. |
Interfaces
| Label | Description | Data |
|---|---|---|
| PassThroughOptions | Defines passthrough(pt) options of IftaLabel component. | [object Object] |
Types
| Label | Description | Data |
|---|---|---|
| Instance | Instance of IftaLabel component. | [object Object] |
useIftaLabel
Props
State
Exposes
Interfaces
Types
테마 (Theming)
CSS 클래스 (CSS Classes)
styled 모드에서 사용하는 클래스 이름 목록이에요.
| ClassName | Description |
|---|---|
| p-iftalabel | Class name of the root element |
디자인 토큰 (Design Tokens)
디자인 토큰 목록이에요.
| Token | CSS Variable | Description |
|---|---|---|
| iftalabel.color | --p-iftalabel-color | Color of root |
| iftalabel.focus.color | --p-iftalabel-focus-color | Focus color of root |
| iftalabel.invalid.color | --p-iftalabel-invalid-color | Invalid color of root |
| iftalabel.transition.duration | --p-iftalabel-transition-duration | Transition duration of root |
| iftalabel.position.x | --p-iftalabel-position-x | Position x of root |
| iftalabel.top | --p-iftalabel-top | Top of root |
| iftalabel.font.size | --p-iftalabel-font-size | Font size of root |
| iftalabel.font.weight | --p-iftalabel-font-weight | Font weight of root |
| iftalabel.input.padding.top | --p-iftalabel-input-padding-top | Padding top of input |
| iftalabel.input.padding.bottom | --p-iftalabel-input-padding-bottom | Padding bottom of input |