Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

oxygen-form

БесплатноБез исполняемых скриптовНе проверен

Generate forms with Form.* components and validation. Use when creating input forms, multi-step wizards, or form validation. Covers field labels and…

wso2от wso2★ 67 звёзд на GitHub20 установок в других каталогах

Об этом скилле

Generate Oxygen UI Form

Instructions

  1. Read .claude/oxygen-ui/components.md for Form.* API
  2. Use Form.Section for grouping fields
  3. Use Form.Stack for field layout
  4. Give every field a fixed label on top with labelPlacement="top" (see Field Labels)
  5. Mark each required field with required; leave optional fields unmarked
  6. Give every select a placeholder; ask the developer for the text (see Select and Autocomplete)
  7. Add validation with error and helperText props. Plain Select has no helperText, so use TextField select for any select that shows validation messages

Critical Rules

  • Import form components from @wso2/oxygen-ui
  • Use controlled components with state
  • Show validation errors with error and helperText props
  • Use theme tokens for spacing
  • Use labelPlacement="top" on every TextField in a form; never use the floating label in forms
  • Set required on every required field; never use the optional prop or write "(Optional)" in a label
  • Write all UI text in sentence case (see below)

UI Text

Write all titles, action text, and content in sentence case. Capitalize only the first word, proper nouns, product names, and acronyms.

✓ First name    ✓ Create account    ✓ Enter your email address
✗ First Name    ✗ Create Account    ✗ ENTER YOUR EMAIL ADDRESS
  • Applies to section headers, labels, placeholders, helper text, error messages, and buttons
  • Write the text in sentence case in the source; never change case with textTransform: 'uppercase' or 'capitalize'

Field Labels

Forms use a fixed label above the input, not MUI's floating label. labelPlacement is an Oxygen UI prop, so import TextField from @wso2/oxygen-ui; the MUI TextField ignores it.

<TextField labelPlacement="top" label="Display name" required />  // required: label shows a themed *
<TextField labelPlacement="top" label="Description" />            // optional: no marker

Required fields

  • The developer marks each required field with the required prop. Nothing is required by default
  • required draws a * after the label, colored by the theme, and sets required on the native input, so screen readers announce it
  • Do not add a * to the label text yourself, and do not color labels red; the theme handles it
  • Keep required in sync with validation: every field the form rejects when empty is required, and no other field is

Optional fields

  • Leave optional fields unmarked. Do not pass the optional prop and do not write "(Optional)" in the label, placeholder, or helper text
  • Do not describe a section as optional in its header or subheader; unmarked fields already read as optional

Select and Autocomplete

The same rules apply. Use TextField with select (it supports helperText for validation messages), or Select with labelPlacement="top" (see the oxygen-select skill). Every select needs a placeholder; ask the developer for the text before writing the form, listing each select with a suggestion such as "Select a role", and never invent it. Native selects ignore placeholder, so use that text as the empty option's label instead. A select in error keeps its label colour; the error shows on the border and in helperText. For Autocomplete, pass labelPlacement="top" and required to the TextField in renderInput:

<TextField select labelPlacement="top" label="Role" placeholder="Select a role" required value={role} onChange={...}>
  <MenuItem value="developer">Developer</MenuItem>
</TextField>

<Autocomplete
  options={countries}
  renderInput={(params) => <TextField {...params} labelPlacement="top" label="Country" required />}
/>

Do and don't

✓ <TextField labelPlacement="top" label="Email" required />
✗ <TextField label="Email" required />                       floating label in a form
✗ <TextField labelPlacement="top" label="Email *" />         hand-written asterisk
✗ <TextField labelPlacement="top" label="Phone" optional />  optional marker
✗ <TextField labelPlacement="top" label="Phone (Optional)" />

Basic Form

import { useState } from 'react';
import { Box, Form, TextField, Button } from '@wso2/oxygen-ui';

function BasicForm() {
  const [formData, setFormData] = useState({ name: '', email: '' });
  const [errors, setErrors] = useState<Record<string, string>>({});

  const validate = () => {
    const newErrors: Record<string, string> = {};

    if (!formData.name) {
      newErrors.name = 'Name is required';
    }

    if (!formData.email) {
      newErrors.email = 'Email is required';
    } else if (!/\S+@\S+\.\S+/.test(formData.email)) {
      newErrors.email = 'Invalid email format';
    }

    setErrors(newErrors);
    return Object.keys(newErrors).length === 0;
  };

  const handleSubmit = (e: React.FormEvent) => {
    e.preventDefault();
    if (validate()) {
      console.log('Form submitted:', formData);
    }
  };

  return (
    // noValidate lets validate
Полный SKILL.md на GitHub

Установить oxygen-form в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл oxygen-form?

Generate forms with Form.* components and validation. Use when creating input forms, multi-step wizards, or form validation. Covers field labels and required-field marking.

Как установить скилл oxygen-form?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл oxygen-form запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить oxygen-form с