DOCS
v0.4

Components / Label

Label

Form label with required indicator, hint text, and error text.

typography v0.1.0

Playground

Examples

With hint
<cg-label text="Username" hint="Choose a unique name"></cg-label>
Required
<cg-label text="Email address" required hint="We will never share your email."></cg-label>
Error
<cg-label text="Password" error="Must be at least 8 characters"></cg-label>
Disabled
<cg-label text="Organization" hint="Set by your admin" disabled></cg-label>

Import

import { CgLabel } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/cg-label';

Per-component imports ship only that component (~8 kB gzip).

API Reference

PropTypeDefaultDescription
text string Label text
hint string Hint text below label
error string Error text (replaces hint)
required boolean false Show required asterisk
disabled boolean false Disabled state