shadcn-templ 2.0 beta. Switch to templUI v1
1.7k

Label

Renders an accessible label associated with controls.

package examples import (

Installation

shadcn-templ add label

Usage

import "github.com/axadrn/shadcn-templ/v2/components/label"
@label.Label(label.Props{For: "email"}) {	Your email address}

Label in Field

For form fields, use the Field component which includes built-in field.Label, field.Description, and field.Error components.

@field.Field() {	@field.Label(field.LabelProps{For: "email"}) {		Your email address	}	@input.Input(input.Props{ID: "email"})}
Payment Method

All transactions are secure and encrypted

Enter your 16-digit card number

Billing Address

The billing address associated with your payment method

package examples import (

API Reference

Label

The Label component renders a native label associated with a control.

Prop Type Default
For string -
Class string -