CLI previewInstall commands shown on this site are not released yet.

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/label
bash
npx grassroot@latest add ui/label
bash
yarn dlx grassroot add ui/label
bash
bunx grassroot add ui/label

API Reference

LabelProps
PropTypeDefault
requiredAppend a crimson required marker.boolean | undefinedfalse