mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-25 02:31:41 +00:00
Both old names are owned by a different npm account (artemis-prime), so publishing them returns 403 — which is how this surfaced: the 8.0.0 run shipped @hanzogui/logo and @hanzogui/demos depending on [email protected], a version that cannot be published and therefore does not exist. Those two were uninstallable. @hanzo/gui and @hanzogui/* are ours, so the framework now carries the name it is imported by everywhere downstream, and the loader moves under the scope we control. The rewrite is limited to package references. `DEBUG?.startsWith('hanzogui')` is a log-namespace filter and join(dir, 'hanzogui') is a path — rewriting either would change behaviour, so both are untouched. Co-authored-by: Hanzo Dev <[email protected]>
73 lines
1.3 KiB
Plaintext
73 lines
1.3 KiB
Plaintext
---
|
|
title: Label
|
|
description: Label form elements with accessibility.
|
|
name: label
|
|
component: Label
|
|
package: label
|
|
demoName: Label
|
|
---
|
|
|
|
<HeroContainer>
|
|
<LabelDemo />
|
|
</HeroContainer>
|
|
|
|
```tsx hero template=Label
|
|
|
|
```
|
|
|
|
<Highlights
|
|
features={[
|
|
`Supports nested controls and custom controls.`,
|
|
`Sizable and styleable inline.`,
|
|
`Works on web with aria-labelledby.`,
|
|
]}
|
|
/>
|
|
|
|
## Installation
|
|
|
|
Label is already installed in `hanzogui`, or you can install it independently:
|
|
|
|
```bash
|
|
npm install @hanzogui/label
|
|
```
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import { Label } from '@hanzo/gui'
|
|
|
|
export default () => (
|
|
<>
|
|
<Label htmlFor="name">Name</Label>
|
|
<Input id="name" defaultValue="Nate Wienert" />
|
|
</>
|
|
)
|
|
```
|
|
|
|
## Accessibility
|
|
|
|
Use with Input or other form elements to automatically get correct labelling by id and aria-labelledby. You can also use the provided `useLabelContext` hook to build your own controls.
|
|
|
|
## API Reference
|
|
|
|
### Label
|
|
|
|
Labels extend Stack views inheriting all the [Gui standard props](/docs/intro/props), plus:
|
|
|
|
<PropsTable
|
|
data={[
|
|
{
|
|
name: 'htmlFor',
|
|
type: 'string',
|
|
required: true,
|
|
description: `Matching to a Gui form element id.`,
|
|
},
|
|
{
|
|
name: 'unstyled',
|
|
required: false,
|
|
type: `boolean`,
|
|
description: `Removes all default Gui styles.`,
|
|
},
|
|
]}
|
|
/>
|