# @askrjs/ui/label

> Published API exports for @askrjs/ui/label.

Source: [https://askrjs.com/docs/reference/api/ui/label](https://askrjs.com/docs/reference/api/ui/label)

Status: stable. Packages: @askrjs/ui/label.

**Published packages are authoritative.** Examples may lag behind a published contract. When guidance differs, verify the exports and TypeScript declarations in your installed package, then file an issue.

## Exports

This entrypoint publishes 7 exports from the declarations shipped by @askrjs/ui.

### `Label`

```ts
Label: { (props: LabelLabelProps): JSXElement; (props: LabelAsChildProps): JSXElement; }
```

Renders the `label` part of `label`.

Supports polymorphic rendering via `asChild`.

### `LABEL_A11Y_CONTRACT`

```ts
LABEL_A11Y_CONTRACT: { readonly ELEMENT: "label"; readonly ASSOCIATION_ATTRIBUTE: "for"; readonly DATA_ATTRIBUTES: { readonly slot: "data-slot"; }; readonly NAME_SOURCE_PRIORITY: readonly ["aria-label", "textContent"]; readonly AS_CHILD: { readonly forwardsProps: true; readonly preservesChildElement: true; }; }
```

Native label semantics for askr-ui Label.

### `LabelA11yContract`

```ts
LabelA11yContract: typeof LABEL_A11Y_CONTRACT
```

Type of the Label A11y Contract object.

### `LabelAsChildProps`

```ts
LabelAsChildProps: LabelOwnProps & {
  asChild: true;
  children: JSXElement;
  ref?: Ref<Element>;
}
```

Props for the `asChild` (polymorphic) rendering of Label.

- `asChild`: asChild: true;

- `children`: children: JSXElement;

- `ref`: ref?: Ref<Element>;

### `LabelLabelProps`

```ts
LabelLabelProps: Omit<Props, 'children'> & LabelOwnProps & {
  asChild?: false;
  htmlFor?: string;
  ref?: Ref<HTMLLabelElement>;
}
```

Props for Label Label.

- `asChild`: asChild?: false | undefined;

- `children`: children?: unknown;

- `htmlFor`: htmlFor?: string | undefined;

- `ref`: ref?: Ref<HTMLLabelElement>;

### `LabelOwnProps`

```ts
LabelOwnProps: {
  children?: unknown;
}
```

Own props for Label, before merging with native element attributes.

- `children`: children?: unknown;

### `LabelProps`

```ts
LabelProps: LabelLabelProps | LabelAsChildProps
```

Props for Label.

- `asChild`: asChild?: boolean | undefined;

- `children`: children?: unknown;

- `ref`: ref?: ((value: Element | null) => void) | { current: Element | null; } | ((value: HTMLLabelElement | null) => void) | { current: HTMLLabelElement | null; } | null | undefined;

## Documentation navigation

[Previous](https://askrjs.com/docs/reference/api/ui/form/index.md) | [Next](https://askrjs.com/docs/reference/api/ui/progress/index.md)
