Command Palette

Search for a command to run...

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

oxygen-select

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

Use the Oxygen UI Select with a fixed label above the field instead of MUI's floating label, and a placeholder the developer provides. Use ComplexSelect with…

wso2от wso2★ 67 звёзд на GitHub

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

Fixed-Label Select

Oxygen UI selects use a fixed label that sits above the field and never moves. Do not use MUI's floating label, which starts inside the field and shrinks into the border on focus. The floating variant still works, but only for existing screens; never write new code with it.

Fixed label (use)          Floating label (don't use)
Environment                ┌─ Environment ───────┐
┌─────────────────────┐    │ Production        ▾ │
│ Production        ▾ │    └─────────────────────┘
└─────────────────────┘

Instructions

  1. Import Select from @wso2/oxygen-ui, never from @mui/material. labelPlacement is an Oxygen UI prop, and the MUI Select ignores it.
  2. Add labelPlacement="top" and label to every Select. Do not wrap it in FormControl or add an InputLabel; the component draws its own.
  3. Give every Select a placeholder. Get the text from the developer; never make it up (see Placeholder text).
  4. Mark required selects with required; the theme draws the *.
  5. When the select needs helper text or validation messages, use TextField select labelPlacement="top" instead (see the oxygen-textfield skill). It has the same fixed label, supports helperText, and takes the same placeholder.
  6. For forms (validation, sections, wizards), also follow the oxygen-form skill.

Usage

import { Select, MenuItem } from '@wso2/oxygen-ui';

<Select
  labelPlacement="top"
  label="Environment"
  placeholder="Select an environment"
  required
  value={env}
  onChange={(e) => setEnv(e.target.value)}
>
  <MenuItem value="dev">Development</MenuItem>
  <MenuItem value="prod">Production</MenuItem>
</Select>

With helper text:

import { TextField, MenuItem } from '@wso2/oxygen-ui';

<TextField
  select
  labelPlacement="top"
  label="Environment"
  placeholder="Select an environment"
  helperText="Where the component is deployed."
  value={env}
  onChange={(e) => setEnv(e.target.value)}
>
  <MenuItem value="dev">Development</MenuItem>
  <MenuItem value="prod">Production</MenuItem>
</TextField>

Placeholder text

Every select shows a placeholder while nothing is selected. The developer owns this text, so ask for it.

  1. Before writing the code, check whether the developer has given placeholder text for each select.

  2. If any is missing, ask the developer once, listing every select that needs one by its label. Offer a suggestion for each so they can accept or change it, for example:

    Placeholder text needed for these selects. Reply with your text, or "ok" to use the suggestions:
    - Environment: "Select an environment"
    - Region: "Select a region"
    
  3. Use the developer's text exactly as given. Do not write code with placeholder text the developer has not provided or accepted.

  4. If you can't ask (for example, in a non-interactive run), use the suggestions and list them in your summary so the developer can review them.

Suggestions follow these rules:

  • Start with "Select" and name the thing chosen, in sentence case: "Select a region", not "Select Region" or "Choose…"
  • No trailing punctuation or ellipsis
  • Don't repeat "(Optional)" or "*" from the label
  • Never use the placeholder in place of a label

How it behaves

  • The label renders as a FormLabel above the select and keeps its colour on focus and in the error state; the error shows on the field's border and in helper text. Focus shows only on the field: in the default theme, a text-colour border with a Cobalt ring, the same as fixed-label text fields.
  • The label names the combobox through labelId (or htmlFor with native), so screen readers announce it. Do not add your own aria-label when a label is set.
  • sx, className, style, fullWidth and ref apply to the outer wrapper that holds the label and the select. size, variant, required, error and disabled apply to both.
  • placeholder shows text in the field while nothing is selected (an empty value: '', null, undefined or []), in the secondary text colour so it meets contrast requirements. It works with a custom renderValue. Native selects ignore it, so give them an empty option with the developer's placeholder text instead: <option value="">Select a role</option>.
  • Without a label, the prop has no effect and the select renders as a plain MUI Select.

ComplexSelect: keep the label inside

ComplexSelect (rich options with icons, avatars and list headers, such as the organization and project switchers in Header.Switchers) follows a different rule from Select. Its label sits inside the field, above the selected value. This is the default labelAnchor, inside.

  1. Pass label and do not set labelAnchor. The default is inside.
  2. Do not use labelAnchor="outside" or labelAnchor="border" in new code. They are kept for existing screens only. When you edit a ComplexSelect that sets either, ask the developer before changing it, as the field's height change
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

FAQ

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

Use the Oxygen UI Select with a fixed label above the field instead of MUI's floating label, and a placeholder the developer provides. Use ComplexSelect with its default inside label. Use when adding or editing any Select, ComplexSelect, dropdown, or picker built on Select, or when converting FormControl + InputLabel + Select code to fixed labels.

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

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

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

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

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

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