package validation import "fmt" func Required() ComponentOption { return func(c *ComponentConfig) { c.Validators = append(c.Validators, func(value any) error { if value == nil || value == "" { return fmt.Errorf("field is required") } return nil }) } }