Home / Function/ SelectInvalid() — ui Function Reference

SelectInvalid() — ui Function Reference

Architecture documentation for the SelectInvalid() function in select-example.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  dd0b5292_c4d9_e724_9774_f670e54f5290["SelectInvalid()"]
  da287030_2184_07ad_21e7_133141a5c3fa["select-example.tsx"]
  dd0b5292_c4d9_e724_9774_f670e54f5290 -->|defined in| da287030_2184_07ad_21e7_133141a5c3fa
  style dd0b5292_c4d9_e724_9774_f670e54f5290 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/bases/base/examples/select-example.tsx lines 471–518

function SelectInvalid() {
  const items = [
    { label: "Select a fruit", value: null },
    { label: "Apple", value: "apple" },
    { label: "Banana", value: "banana" },
    { label: "Blueberry", value: "blueberry" },
    { label: "Grapes", value: "grapes" },
    { label: "Pineapple", value: "pineapple" },
  ]
  return (
    <Example title="Invalid">
      <div className="flex flex-col gap-4">
        <Select items={items}>
          <SelectTrigger aria-invalid="true">
            <SelectValue />
          </SelectTrigger>
          <SelectContent>
            <SelectGroup>
              {items.map((item) => (
                <SelectItem key={item.value} value={item.value}>
                  {item.label}
                </SelectItem>
              ))}
            </SelectGroup>
          </SelectContent>
        </Select>
        <Field data-invalid>
          <FieldLabel htmlFor="select-fruit-invalid">Favorite Fruit</FieldLabel>
          <Select items={items}>
            <SelectTrigger id="select-fruit-invalid" aria-invalid>
              <SelectValue />
            </SelectTrigger>
            <SelectContent>
              <SelectGroup>
                {items.map((item) => (
                  <SelectItem key={item.value} value={item.value}>
                    {item.label}
                  </SelectItem>
                ))}
              </SelectGroup>
            </SelectContent>
          </Select>
          <FieldError errors={[{ message: "Please select a valid fruit." }]} />
        </Field>
      </div>
    </Example>
  )
}

Subdomains

Frequently Asked Questions

What does SelectInvalid() do?
SelectInvalid() is a function in the ui codebase, defined in apps/v4/registry/bases/base/examples/select-example.tsx.
Where is SelectInvalid() defined?
SelectInvalid() is defined in apps/v4/registry/bases/base/examples/select-example.tsx at line 471.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free