DocsComponentsPrimitives
Label
React example follows below.
ts
import { Label } from "@grassroot/ui-react"; <Label htmlFor="email" required>Work email</Label><input id="email" placeholder="you@trajectory.software" />ts
<script setup lang="ts">import { Label } from "@grassroot/ui-vue";</script> <template> <Label html-for="email" required>Work email</Label></template>ts
import { Component } from "@angular/core";import { GrassrootLabel } from "@grassroot/ui-angular"; @Component({ selector: "app-example", standalone: true, imports: [GrassrootLabel], template: ` <grassroot-label htmlFor="email" [required]="true">Work email</grassroot-label> `,})export class ExampleComponent {}ts
<script lang="ts"> import { Label } from "@grassroot/ui-svelte";</script> <Label htmlFor="email" required>Work email</Label>ts
import { Label } from "@grassroot/ui-solid"; export function Example() { return ( <> <Label htmlFor="email" required>Work email</Label> </> );}Installation
bash
pnpm dlx grassroot add ui/labelbash
npx grassroot@latest add ui/labelbash
yarn dlx grassroot add ui/labelbash
bunx grassroot add ui/labelAPI Reference
| Prop | Type | Default |
|---|---|---|
requiredAppend a crimson required marker. | boolean | undefined | false |