Skip to content

Workspace form

Forms
Workspace form

lowercase · dashes

198/2000

Two-column settings form — text fields, an inline error state, and a confidence slider.

field · input · textarea · label · slider
import { Grid } from "@/components/ui/grid"
import { FieldGroup, Field, FieldLabel, FieldDescription, FieldError } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { Slider } from "@/components/ui/slider"
import { Textarea } from "@/components/ui/textarea"

export function WorkspaceForm() {
  return (
    <Grid className="grid-cols-2 gap-7">
      <FieldGroup>
        <Field>
          <FieldLabel>Workspace name *</FieldLabel>
          <Input value="Acme Retrospective" />
        </Field>
        <Field>
          <FieldLabel>Slug</FieldLabel>
          <Input value="acme-retro" />
          <FieldDescription>lowercase · dashes</FieldDescription>
        </Field>
        <Field>
          <FieldLabel>Email</FieldLabel>
          <Input type="email" placeholder="you@company.com" invalid />
          <FieldError>Already in use — try signing in instead</FieldError>
        </Field>
        <Field>
          <FieldLabel>Search</FieldLabel>
          <Input placeholder="Search tickets, docs, people…" />
        </Field>
        <Field>
          <FieldLabel>Confidence threshold</FieldLabel>
          <Slider min={0} max={100} value={65} />
        </Field>
      </FieldGroup>
      <FieldGroup>
        <Field>
          <FieldLabel>Bug description</FieldLabel>
          <Textarea rows={5} value="After clicking 'Retry' in the paying state, the fetcher briefly flashes back to 'idle' before transitioning to 'loading'. Expected: direct paying → loading." />
          <FieldDescription>198/2000</FieldDescription>
        </Field>
      </FieldGroup>
    </Grid>
  )
}
ui26/react
<script lang="ts">
  import Grid from "$lib/components/ui/grid.svelte"
  import FieldGroup from "$lib/components/ui/field-group.svelte"
  import Field from "$lib/components/ui/field.svelte"
  import FieldLabel from "$lib/components/ui/field-label.svelte"
  import Input from "$lib/components/ui/input.svelte"
  import FieldDescription from "$lib/components/ui/field-description.svelte"
  import FieldError from "$lib/components/ui/field-error.svelte"
  import Slider from "$lib/components/ui/slider.svelte"
  import Textarea from "$lib/components/ui/textarea.svelte"
</script>

<Grid class="grid-cols-2 gap-7">
  <FieldGroup>
    <Field>
      <FieldLabel>Workspace name *</FieldLabel>
      <Input value="Acme Retrospective" />
    </Field>
    <Field>
      <FieldLabel>Slug</FieldLabel>
      <Input value="acme-retro" />
      <FieldDescription>lowercase · dashes</FieldDescription>
    </Field>
    <Field>
      <FieldLabel>Email</FieldLabel>
      <Input type="email" placeholder="you@company.com" invalid />
      <FieldError>Already in use — try signing in instead</FieldError>
    </Field>
    <Field>
      <FieldLabel>Search</FieldLabel>
      <Input placeholder="Search tickets, docs, people…" />
    </Field>
    <Field>
      <FieldLabel>Confidence threshold</FieldLabel>
      <Slider min={0} max={100} value={65} />
    </Field>
  </FieldGroup>
  <FieldGroup>
    <Field>
      <FieldLabel>Bug description</FieldLabel>
      <Textarea rows={5} value="After clicking 'Retry' in the paying state, the fetcher briefly flashes back to 'idle' before transitioning to 'loading'. Expected: direct paying → loading." />
      <FieldDescription>198/2000</FieldDescription>
    </Field>
  </FieldGroup>
</Grid>
ui26/svelte
---
import Grid from "@/components/ui/grid.astro"
import FieldGroup from "@/components/ui/field-group.astro"
import Field from "@/components/ui/field.astro"
import FieldLabel from "@/components/ui/field-label.astro"
import Input from "@/components/ui/input.astro"
import FieldDescription from "@/components/ui/field-description.astro"
import FieldError from "@/components/ui/field-error.astro"
import Slider from "@/components/ui/slider.astro"
import Textarea from "@/components/ui/textarea.astro"
---

<Grid class="grid-cols-2 gap-7">
  <FieldGroup>
    <Field>
      <FieldLabel>Workspace name *</FieldLabel>
      <Input value="Acme Retrospective" />
    </Field>
    <Field>
      <FieldLabel>Slug</FieldLabel>
      <Input value="acme-retro" />
      <FieldDescription>lowercase · dashes</FieldDescription>
    </Field>
    <Field>
      <FieldLabel>Email</FieldLabel>
      <Input type="email" placeholder="you@company.com" invalid />
      <FieldError>Already in use — try signing in instead</FieldError>
    </Field>
    <Field>
      <FieldLabel>Search</FieldLabel>
      <Input placeholder="Search tickets, docs, people…" />
    </Field>
    <Field>
      <FieldLabel>Confidence threshold</FieldLabel>
      <Slider min={0} max={100} value={65} />
    </Field>
  </FieldGroup>
  <FieldGroup>
    <Field>
      <FieldLabel>Bug description</FieldLabel>
      <Textarea rows={5} value="After clicking 'Retry' in the paying state, the fetcher briefly flashes back to 'idle' before transitioning to 'loading'. Expected: direct paying → loading." />
      <FieldDescription>198/2000</FieldDescription>
    </Field>
  </FieldGroup>
</Grid>
ui26/astro
{
  "root": "form-grid",
  "elements": {
    "form-grid": {
      "type": "Grid",
      "props": {
        "className": "grid-cols-2 gap-7"
      },
      "children": [
        "left-col",
        "right-col"
      ]
    },
    "left-col": {
      "type": "FieldGroup",
      "props": {},
      "children": [
        "f-workspace",
        "f-slug",
        "f-email",
        "f-search",
        "f-threshold"
      ]
    },
    "f-workspace": {
      "type": "Field",
      "props": {},
      "children": [
        "lbl-workspace",
        "in-workspace"
      ]
    },
    "lbl-workspace": {
      "type": "FieldLabel",
      "props": {
        "text": "Workspace name *"
      },
      "children": []
    },
    "in-workspace": {
      "type": "Input",
      "props": {
        "value": "Acme Retrospective"
      },
      "children": []
    },
    "f-slug": {
      "type": "Field",
      "props": {},
      "children": [
        "lbl-slug",
        "in-slug",
        "desc-slug"
      ]
    },
    "lbl-slug": {
      "type": "FieldLabel",
      "props": {
        "text": "Slug"
      },
      "children": []
    },
    "in-slug": {
      "type": "Input",
      "props": {
        "value": "acme-retro"
      },
      "children": []
    },
    "desc-slug": {
      "type": "FieldDescription",
      "props": {
        "text": "lowercase · dashes"
      },
      "children": []
    },
    "f-email": {
      "type": "Field",
      "props": {},
      "children": [
        "lbl-email",
        "in-email",
        "err-email"
      ]
    },
    "lbl-email": {
      "type": "FieldLabel",
      "props": {
        "text": "Email"
      },
      "children": []
    },
    "in-email": {
      "type": "Input",
      "props": {
        "type": "email",
        "placeholder": "you@company.com",
        "invalid": true
      },
      "children": []
    },
    "err-email": {
      "type": "FieldError",
      "props": {
        "text": "Already in use — try signing in instead"
      },
      "children": []
    },
    "f-search": {
      "type": "Field",
      "props": {},
      "children": [
        "lbl-search",
        "in-search"
      ]
    },
    "lbl-search": {
      "type": "FieldLabel",
      "props": {
        "text": "Search"
      },
      "children": []
    },
    "in-search": {
      "type": "Input",
      "props": {
        "placeholder": "Search tickets, docs, people…"
      },
      "children": []
    },
    "f-threshold": {
      "type": "Field",
      "props": {},
      "children": [
        "lbl-threshold",
        "sl-threshold"
      ]
    },
    "lbl-threshold": {
      "type": "FieldLabel",
      "props": {
        "text": "Confidence threshold"
      },
      "children": []
    },
    "sl-threshold": {
      "type": "Slider",
      "props": {
        "min": 0,
        "max": 100,
        "value": 65
      },
      "children": []
    },
    "right-col": {
      "type": "FieldGroup",
      "props": {},
      "children": [
        "f-bug"
      ]
    },
    "f-bug": {
      "type": "Field",
      "props": {},
      "children": [
        "lbl-bug",
        "ta-bug",
        "desc-bug"
      ]
    },
    "lbl-bug": {
      "type": "FieldLabel",
      "props": {
        "text": "Bug description"
      },
      "children": []
    },
    "ta-bug": {
      "type": "Textarea",
      "props": {
        "rows": 5,
        "value": "After clicking 'Retry' in the paying state, the fetcher briefly flashes back to 'idle' before transitioning to 'loading'. Expected: direct paying → loading."
      },
      "children": []
    },
    "desc-bug": {
      "type": "FieldDescription",
      "props": {
        "text": "198/2000"
      },
      "children": []
    }
  }
}
ui26/json-render